:root {
  --bg-canvas: #070b12;
  --bg-elevated: #0b111b;
  --bg-panel: rgba(18, 25, 38, 0.99);
  --bg-panel-soft: rgba(26, 34, 50, 0.97);
  --bg-input: rgba(11, 17, 27, 0.99);
  --border-color: rgba(164, 179, 201, 0.22);
  --border-strong: rgba(164, 179, 201, 0.34);
  --text-main: #f3f6fb;
  --text-soft: #c5cedd;
  --text-muted: #8d99ad;
  --accent-teal: #3fc6a8;
  --accent-gold: #e4ab52;
  --accent-red: #e67a73;
  --accent-blue: #7b94ff;
  --shadow-strong: 0 18px 42px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 10px 26px rgba(0, 0, 0, 0.22);
  --radius-panel: 16px;
  --radius-card: 14px;
  --radius-control: 12px;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(123, 148, 255, 0.08), transparent 26%),
    linear-gradient(180deg, #06090f 0%, #09101a 48%, #070b12 100%);
  color: var(--text-main);
  font-family: "SF Pro Display", "Segoe UI Variable Text", "Aptos", "Helvetica Neue", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 14px;
}

.page-frame {
  margin-top: 12px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-panel);
  background:
    linear-gradient(180deg, rgba(20, 27, 41, 0.95), rgba(11, 17, 27, 0.99));
  box-shadow: var(--shadow-soft);
}

.brand-cluster,
.user-cluster,
.sensor-card__header,
.map-overlay__header,
.detail-head,
.detail-layout,
.panel-heading,
.profile-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-logo {
  width: 190px;
  max-width: 38vw;
  height: auto;
}

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand-copy h1,
.sensor-card h4,
.map-overlay h4,
.detail-head h2,
.panel-heading h3,
.profile-panel h2,
.detail-side-card h3,
.detail-missing h2 {
  margin: 0;
  font-family: "SF Pro Display", "Segoe UI Variable Display", "Aptos Display", sans-serif;
  letter-spacing: -0.015em;
}

.brand-copy h1 {
  font-size: 1.2rem;
  font-weight: 630;
  position: relative;
  left: 16px;
  top: 2px;
}

.eyebrow,
.section-tag {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.67rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  background: rgba(123, 148, 255, 0.09);
  color: #c7d4f8;
  border: 1px solid rgba(123, 148, 255, 0.12);
}

.muted-label,
.asset-code,
.detail-subtitle,
.metric-label,
.card-kicker,
.profile-label,
.user-email {
  color: var(--text-muted);
}

.user-cluster-link {
  margin-left: auto;
}

.user-cluster {
  padding: 8px 8px 8px 12px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
  background: rgba(17, 23, 34, 0.88);
}

.user-meta {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.user-name {
  font-size: 0.95rem;
  font-weight: 640;
  letter-spacing: 0.02em;
}

.user-email {
  font-size: 0.82rem;
}

.user-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(30, 39, 56, 0.88);
  overflow: hidden;
  flex: 0 0 auto;
}

.avatar-head,
.avatar-body {
  position: absolute;
  left: 50%;
  background: #f6f7fb;
  transform: translateX(-50%);
}

.avatar-head {
  top: 9px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
}

.avatar-body {
  bottom: 8px;
  width: 24px;
  height: 17px;
  border-radius: 14px 14px 6px 6px;
}

.dashboard-page,
.detail-page,
.profile-page,
.add-sensor-page {
  display: grid;
  gap: 12px;
}

.dashboard-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.dashboard-toolbar .tab-parent {
  flex: 1 1 auto;
}

.detail-toolbar,
.profile-toolbar {
  display: flex;
  align-items: flex-end;
  width: 100%;
  gap: 0;
}

.detail-tab-parent,
.profile-tab-parent {
  display: block;
  margin-left: auto;
  margin-bottom: -1px;
}

.detail-tab-shell,
.profile-tab-shell {
  background: transparent !important;
  border: none !important;
}

.detail-tab-shell > .detail-tab-button,
.detail-tab-shell > .detail-tab-button--selected,
.profile-tab-shell > .profile-tab-button,
.profile-tab-shell > .profile-tab-button--selected {
  margin-right: 6px;
}

.detail-tab-shell:last-child > .detail-tab-button,
.detail-tab-shell:last-child > .detail-tab-button--selected,
.profile-tab-shell:last-child > .profile-tab-button,
.profile-tab-shell:last-child > .profile-tab-button--selected {
  margin-right: 0;
}

.detail-tab-button,
.detail-tab-button--selected,
.profile-tab-button,
.profile-tab-button--selected {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  padding: 8px 13px !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 11px 11px 0 0 !important;
  background: rgba(12, 17, 27, 0.72) !important;
  color: var(--text-muted) !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.detail-tab-button,
.detail-tab-button--selected {
  max-width: 156px;
}

.profile-tab-button,
.profile-tab-button--selected {
  max-width: 188px;
}

.detail-tab-button--selected {
  background: rgba(21, 31, 46, 0.94) !important;
  border-color: var(--border-strong) !important;
  color: var(--text-main) !important;
}

.profile-tab-button--selected {
  background: rgba(21, 31, 46, 0.94) !important;
  border-color: var(--border-strong) !important;
  color: var(--text-main) !important;
}

.add-sensor-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 1px;
  margin-right: 8px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(17, 23, 34, 0.92);
  color: var(--text-main);
  box-shadow: var(--shadow-soft);
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.add-sensor-button__glyph {
  display: block;
  font-size: 1.35rem;
  font-weight: 520;
  line-height: 1;
  transform: translate(-0.5px, -1px);
}

.add-sensor-button:hover,
.add-sensor-button:focus-visible {
  background: rgba(123, 148, 255, 0.12);
  border-color: rgba(123, 148, 255, 0.22);
  transform: translateY(-1px);
}

.tab-parent {
  display: block;
  margin-bottom: -1px;
}

.tab-shell {
  background: transparent !important;
  border: none !important;
}

.tab-shell > .tab-button,
.tab-shell > .tab-button--selected {
  margin-right: 6px;
}

.tab-button,
.tab-button--selected {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  max-width: 128px;
  padding: 8px 13px !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 11px 11px 0 0 !important;
  background: rgba(12, 17, 27, 0.72) !important;
  color: var(--text-muted) !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.tab-button--selected {
  background: rgba(21, 31, 46, 0.94) !important;
  border-color: var(--border-strong) !important;
  color: var(--text-main) !important;
}

.overview-panel,
.locations-panel,
.detail-main-card,
.detail-side-card,
.trend-card,
.detail-missing,
.profile-panel,
.page-content-panel {
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-panel);
  background: linear-gradient(180deg, rgba(20, 28, 42, 0.99), rgba(12, 18, 28, 0.99));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), var(--shadow-strong);
}

.overview-panel,
.locations-panel,
.page-content-panel {
  border-top-left-radius: 8px;
}

.page-content-panel--sectioned {
  gap: 14px;
}

.dashboard-tab-content {
  min-width: 0;
}

.sensor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 12px;
}

.sensor-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.sensor-card {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 10px;
  min-width: 0;
  min-height: 304px;
  padding: 13px;
  overflow: hidden;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
  background: linear-gradient(180deg, rgba(23, 32, 47, 0.99), rgba(13, 19, 29, 0.99));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 10px 24px rgba(0, 0, 0, 0.17);
}

.sensor-card-link:hover .sensor-card,
.sensor-card-link:focus-visible .sensor-card {
  border-color: rgba(123, 148, 255, 0.22);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  transform: translateY(-1px);
}

.sensor-card-link:focus-visible {
  outline: none;
}

.sensor-card__header,
.map-overlay__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.sensor-card__header > *,
.map-overlay__header > * {
  min-width: 0;
}

.sensor-card > *,
.map-overlay > *,
.sensor-card__body,
.sensor-card__footer,
.metric-grid,
.detail-stat-grid,
.detail-side-metrics {
  width: 100%;
  min-width: 0;
}

.sensor-card__title {
  display: grid;
  gap: 3px;
  flex: 1 1 auto;
  min-height: 68px;
  min-width: 0;
  align-content: start;
}

.sensor-card__title--overlay {
  min-height: 0;
}

.sensor-card__body {
  display: grid;
  gap: 12px;
  align-content: start;
}

.sensor-card__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.sensor-card__footer--overlay {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.sensor-card__status-text {
  display: grid;
  gap: 4px;
  width: 100%;
  min-width: 0;
  align-self: stretch;
}

.metric-value--status {
  display: block;
  width: 100%;
  font-size: 0.9rem;
  line-height: 1.42;
  color: var(--text-soft);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.sensor-card__status-text .metric-value--status {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.asset-code,
.detail-subtitle,
.status-pill {
  letter-spacing: 0.02em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: fit-content;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.72rem;
  font-weight: 680;
  text-align: center;
  white-space: nowrap;
  flex: 0 0 auto;
  justify-self: end;
}

.status--healthy {
  background: rgba(63, 198, 168, 0.11);
  border-color: rgba(63, 198, 168, 0.16);
  color: #8de1c9;
}

.status--attention {
  background: rgba(228, 171, 82, 0.12);
  border-color: rgba(228, 171, 82, 0.18);
  color: #f1cb8a;
}

.status--critical {
  background: rgba(230, 122, 115, 0.12);
  border-color: rgba(230, 122, 115, 0.18);
  color: #efaca6;
}

.status--offline {
  background: rgba(141, 153, 174, 0.14);
  border-color: rgba(141, 153, 174, 0.18);
  color: #ccd3dd;
}

.metric-grid,
.detail-stat-grid,
.detail-side-metrics {
  display: grid;
  gap: 10px;
}

.metric-grid--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

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

.detail-side-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-tile {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(27, 36, 52, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.metric-value {
  font-size: 0.84rem;
  font-weight: 680;
  line-height: 1.3;
  white-space: nowrap;
}

.gauge-graph,
.trend-graph {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.gauge-graph--compact {
  height: 126px;
}

.gauge-graph--overlay {
  height: 108px;
}

.gauge-graph--detail {
  min-height: 330px;
}

.gauge-graph--detail-compact {
  min-height: 186px;
}

.gauge-graph .js-plotly-plot,
.gauge-graph .plot-container,
.gauge-graph .svg-container,
.trend-graph .js-plotly-plot,
.trend-graph .plot-container,
.trend-graph .svg-container {
  width: 100% !important;
}

.gauge-graph--compact .js-plotly-plot,
.gauge-graph--compact .plot-container,
.gauge-graph--compact .svg-container {
  height: 126px !important;
}

.gauge-graph--overlay .js-plotly-plot,
.gauge-graph--overlay .plot-container,
.gauge-graph--overlay .svg-container {
  height: 108px !important;
}

.gauge-graph--detail .js-plotly-plot,
.gauge-graph--detail .plot-container,
.gauge-graph--detail .svg-container {
  min-height: 330px !important;
}

.gauge-graph--detail-compact .js-plotly-plot,
.gauge-graph--detail-compact .plot-container,
.gauge-graph--detail-compact .svg-container {
  height: 186px !important;
}

.overlay-close:hover,
.back-link:hover,
.profile-save-button:hover {
  background: rgba(123, 148, 255, 0.08);
  border-color: rgba(123, 148, 255, 0.16);
}

.panel-heading {
  margin-bottom: 12px;
  align-items: flex-start;
}

.panel-heading p,
.detail-note,
.detail-missing p,
.profile-panel p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.panel-heading p {
  max-width: 420px;
  text-align: right;
}

.map-surface {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: min(64vh, 620px);
  min-height: 360px;
  margin: 0 auto;
  border-radius: var(--radius-panel);
  border: 1px solid var(--border-color);
  background: rgba(6, 9, 16, 0.84);
}

.map-surface--detail {
  height: 248px;
  min-height: 248px;
  border-radius: 12px;
}

.map-zoom-controls {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  display: grid;
  gap: 8px;
}

.map-zoom-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: rgba(10, 15, 24, 0.90);
  color: var(--text-main);
  font-size: 1.15rem;
  font-weight: 520;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  transition: background-color 140ms ease, border-color 140ms ease;
}

.map-zoom-button:hover {
  background: rgba(123, 148, 255, 0.10);
  border-color: rgba(123, 148, 255, 0.18);
}

.facility-map-graph,
.facility-map-graph .js-plotly-plot,
.facility-map-graph .plot-container,
.facility-map-graph .svg-container {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-panel);
}

.map-markers,
.map-overlay-slot {
  position: absolute;
  inset: 0;
}

.map-markers {
  pointer-events: none;
}

.map-clear-selection-trigger {
  display: none;
}

.map-marker {
  position: absolute;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  background: transparent;
  transform: translate(-50%, -50%);
  cursor: pointer;
  pointer-events: auto;
  z-index: 1;
}

.map-marker:hover,
.map-marker:focus-visible {
  z-index: 5;
}

.map-marker__pulse {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 2px solid currentColor;
  background: rgba(10, 15, 24, 0.78);
  box-shadow: 0 0 0 5px rgba(10, 15, 24, 0.18);
}

.map-marker__label {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f3f6fb;
  font-size: 0.67rem;
  font-weight: 760;
  letter-spacing: 0.01em;
}

.map-marker__tooltip {
  position: absolute;
  left: calc(100% - 2px);
  bottom: calc(100% + 6px);
  display: grid;
  gap: 2px;
  width: max-content;
  min-width: 132px;
  max-width: min(280px, calc(100vw - 48px));
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: rgba(10, 15, 24, 0.96);
  color: var(--text-main);
  text-align: left;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-14%) translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  pointer-events: none;
}

.map-marker__tooltip strong,
.map-marker__tooltip span {
  display: block;
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.map-marker__tooltip strong {
  font-size: 0.78rem;
  font-weight: 680;
}

.map-marker__tooltip span {
  color: var(--text-muted);
  font-size: 0.71rem;
  font-weight: 560;
}

.map-marker:hover .map-marker__tooltip,
.map-marker:focus-visible .map-marker__tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-14%) translateY(0);
}

.map-marker.status--healthy {
  color: var(--accent-teal);
}

.map-marker.status--attention {
  color: var(--accent-gold);
}

.map-marker.status--critical {
  color: var(--accent-red);
}

.map-marker.status--offline {
  color: #bcc5d2;
}

.map-overlay-slot {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 14px 16px 16px;
  pointer-events: none;
}

.map-overlay {
  width: min(274px, calc(100% - 32px));
  display: block;
  padding: 0;
  overflow: visible;
  border: none;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
}
.map-overlay .sensor-card-link {
  display: block;
}

.map-overlay .sensor-card {
  min-height: 0;
}

.profile-save-button {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.back-link {
  display: inline-flex;
  width: fit-content;
  height: 35px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 13px;
  margin-top: 9px;
  margin-bottom: -1px;
  border: 1px solid var(--border-color);
  border-radius: 11px 11px 0 0;
  background: rgba(12, 17, 27, 0.72);
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.1;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.back-link__arrow {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-left: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg) translate(1px, -1px);
}

.back-link__label {
  display: inline-block;
  transform: translateY(-0.5px);
}

.detail-head,
.detail-layout,
.detail-main-card,
.detail-side-card,
.trend-card,
.profile-shell,
.profile-panel,
.page-content-panel {
  align-items: flex-start;
}

.detail-head-copy {
  display: grid;
  gap: 6px;
}

.detail-asset-id {
  font-size: 0.9rem;
}

.detail-top-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr);
  align-items: start;
  gap: 14px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  align-items: start;
}

.detail-main-card,
.detail-side-card,
.trend-card,
.profile-panel,
.page-content-panel {
  display: grid;
  gap: 14px;
}

.panel-heading > div {
  display: grid;
  gap: 6px;
}

.panel-heading--compact {
  margin-bottom: 2px;
}

.detail-live-layout {
  display: grid;
  gap: 12px;
}

.detail-metric-sections {
  display: grid;
  gap: 12px;
}

.detail-metric-section {
  display: grid;
  gap: 10px;
}

.detail-section-heading h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 640;
  letter-spacing: -0.01em;
}

.detail-stat-grid--grouped {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-note {
  min-height: 0;
}

.detail-note--summary {
  color: var(--text-main);
  font-weight: 600;
}

.detail-support-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr);
  gap: 14px;
}

.detail-chart-stack {
  display: grid;
  gap: 14px;
}

.detail-installation-stack {
  display: grid;
  gap: 14px;
}

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

.detail-chart-card {
  min-width: 0;
}

.detail-chart-card--wide {
  min-width: 0;
}

.detail-installation-map-card,
.detail-installation-map-graph,
.detail-installation-map-graph .js-plotly-plot,
.detail-installation-map-graph .plot-container,
.detail-installation-map-graph .svg-container {
  width: 100%;
  min-width: 0;
  border-radius: 12px;
  overflow: hidden;
}

.detail-range-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-range-selector label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.83rem;
}

.detail-range-selector input {
  accent-color: var(--accent-blue);
}

.detail-photo-card,
.detail-tech-card {
  min-width: 0;
}

.detail-photo-placeholder {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background:
    linear-gradient(135deg, rgba(48, 56, 70, 0.82), rgba(16, 22, 33, 0.96)),
    radial-gradient(circle at 20% 20%, rgba(123, 148, 255, 0.08), transparent 30%);
}

.detail-photo-fan {
  position: absolute;
  left: 12%;
  top: 22%;
  width: 52%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 16px solid rgba(210, 218, 232, 0.14);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.03),
    0 24px 50px rgba(0, 0, 0, 0.18);
}

.detail-photo-fan::before,
.detail-photo-fan::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-photo-fan::after {
  inset: 40%;
  background: rgba(255, 255, 255, 0.08);
}

.detail-photo-sensor {
  position: absolute;
  right: 18%;
  top: 27%;
  width: 48px;
  height: 22px;
  border-radius: 8px;
  border: 1px solid rgba(143, 188, 255, 0.35);
  background: rgba(143, 188, 255, 0.16);
  box-shadow: 0 0 0 8px rgba(143, 188, 255, 0.05);
}

.detail-photo-sensor::after {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  width: 56px;
  height: 2px;
  background: rgba(143, 188, 255, 0.42);
  transform: translateY(-50%);
}

.detail-photo-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(9, 13, 21, 0.72);
  backdrop-filter: blur(10px);
}

.detail-photo-caption strong {
  font-size: 0.86rem;
}

.detail-photo-caption span {
  color: var(--text-muted);
  font-size: 0.75rem;
}

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

.profile-shell {
  display: grid;
}

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

.add-sensor-section {
  min-width: 0;
}

.add-sensor-section--wide {
  grid-column: span 2;
}

.add-sensor-form-grid,
.add-sensor-coordinate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.add-sensor-dropdown .Select-control,
.add-sensor-dropdown .Select-menu-outer,
.add-sensor-dropdown .Select-menu,
.add-sensor-dropdown .Select-option,
.add-sensor-dropdown .VirtualizedSelectOption,
.add-sensor-dropdown .VirtualizedSelectFocusedOption,
.add-sensor-dropdown .Select-value,
.add-sensor-dropdown .Select-value-label,
.add-sensor-dropdown .Select-placeholder,
.add-sensor-dropdown .Select-input > input,
.add-sensor-dropdown .Select-arrow-zone,
.add-sensor-dropdown .Select-clear-zone,
.add-sensor-dropdown .Select-arrow {
  background: var(--bg-input) !important;
  color: var(--text-main) !important;
  border-color: rgba(255, 255, 255, 0.07) !important;
}

.add-sensor-dropdown .Select-control {
  min-height: 44px;
  border-radius: 10px;
  box-shadow: none !important;
}

.add-sensor-dropdown.is-open > .Select-control,
.add-sensor-dropdown.is-focused:not(.is-open) > .Select-control {
  background: var(--bg-input) !important;
  border-color: rgba(123, 148, 255, 0.22) !important;
  box-shadow: none !important;
}

.add-sensor-dropdown .Select-menu-outer,
.add-sensor-dropdown .Select-menu {
  border-radius: 10px;
  overflow: hidden;
}

.add-sensor-dropdown .Select-option,
.add-sensor-dropdown .VirtualizedSelectOption {
  background: var(--bg-input) !important;
  color: var(--text-main) !important;
}

.add-sensor-dropdown .Select-option.is-focused,
.add-sensor-dropdown .Select-option.is-selected,
.add-sensor-dropdown .VirtualizedSelectFocusedOption {
  background: rgba(123, 148, 255, 0.14) !important;
  color: var(--text-main) !important;
}

.add-sensor-dropdown .Select-placeholder,
.add-sensor-dropdown .Select-value-label,
.add-sensor-dropdown .Select-input > input,
.add-sensor-dropdown .Select-arrow,
.add-sensor-dropdown .Select-clear {
  color: var(--text-main) !important;
}

.add-sensor-dropdown,
.add-sensor-dropdown.dash-dropdown,
.add-sensor-dropdown.dash-dropdown[data-state="open"],
.add-sensor-dropdown.dash-dropdown[data-state="closed"] {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 10px;
  background: var(--bg-input) !important;
  color: var(--text-main) !important;
  box-shadow: none !important;
}

.add-sensor-dropdown .dash-dropdown-trigger,
.add-sensor-dropdown .dash-dropdown-value,
.add-sensor-dropdown .dash-dropdown-value-item,
.add-sensor-dropdown .dash-dropdown-trigger-icon {
  background: transparent !important;
  color: var(--text-main) !important;
}

.dash-dropdown-content {
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 10px !important;
  background: var(--bg-input) !important;
  color: var(--text-main) !important;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28) !important;
}

.dash-dropdown-search-container,
.dash-dropdown-search {
  background: var(--bg-input) !important;
  color: var(--text-main) !important;
}

.dash-dropdown-search {
  border: none !important;
}

.dash-dropdown-option,
.dash-options-list-option,
.dash-options-list-option-wrapper,
.dash-options-list-option-text {
  background: var(--bg-input) !important;
  color: var(--text-main) !important;
}

.dash-options-list-option.selected,
.dash-options-list-option:hover,
.dash-dropdown-option:hover {
  background: rgba(123, 148, 255, 0.14) !important;
}

.add-sensor-map-graph,
.add-sensor-map-graph .js-plotly-plot,
.add-sensor-map-graph .plot-container,
.add-sensor-map-graph .svg-container {
  width: 100%;
  height: 324px;
  border-radius: 12px;
  overflow: hidden;
}

.new-sensor-map-surface {
  border-radius: 12px;
  min-height: 324px;
}

.new-sensor-placement-marker {
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  background: rgba(123, 148, 255, 0.96);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
}

.new-sensor-placement-marker span {
  display: block;
  line-height: 1;
  transform: translateY(-1px);
}

.add-sensor-map-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.add-sensor-secondary-button {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
}

.add-sensor-upload {
  display: block;
}

.add-sensor-upload-inner {
  display: grid;
  gap: 4px;
  padding: 22px 18px;
  border: 1px dashed rgba(123, 148, 255, 0.24);
  border-radius: 12px;
  background: rgba(123, 148, 255, 0.05);
  text-align: center;
}

.add-sensor-upload-inner strong {
  font-size: 0.92rem;
}

.add-sensor-upload-inner span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.add-sensor-photo-preview {
  min-height: 220px;
}

.add-sensor-photo-placeholder,
.add-sensor-photo-preview-card {
  display: grid;
  gap: 6px;
  height: 100%;
  min-height: 220px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(18, 24, 36, 0.76);
}

.add-sensor-photo-placeholder {
  place-content: center;
  text-align: center;
}

.add-sensor-photo-placeholder span,
.add-sensor-photo-meta span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.add-sensor-photo-image {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 10px;
}

.add-sensor-photo-meta {
  display: grid;
  gap: 2px;
}

.add-sensor-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

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

.profile-field {
  display: grid;
  gap: 6px;
}

.profile-field:last-child:nth-child(odd) {
  grid-column: span 2;
}

.profile-label {
  font-size: 0.82rem;
}

.profile-input,
.profile-textarea {
  width: 100%;
  min-width: 0;
}

.profile-input input,
.profile-textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text-main);
  line-height: 1.4;
  box-sizing: border-box;
}

.profile-input input {
  min-height: 44px;
}

.profile-input input[readonly] {
  color: var(--text-soft);
  cursor: default;
}

.profile-input input[type="number"] {
  appearance: textfield;
}

.profile-input input[type="number"]::-webkit-outer-spin-button,
.profile-input input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.profile-textarea {
  min-height: 108px;
  resize: vertical;
}

.profile-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-input);
  color: var(--text-main);
}

.profile-toggle-row {
  display: grid;
  gap: 10px;
}

.profile-checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
}

.profile-save-status {
  color: var(--text-soft);
  min-height: 1.3rem;
}

.profile-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-panel--empty {
  min-height: 320px;
}

@media (max-width: 1180px) {
  .detail-layout,
  .detail-top-layout,
  .detail-support-layout {
    grid-template-columns: 1fr;
  }

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

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

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

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

  .metric-grid--card .metric-tile:last-child {
    grid-column: span 2;
  }
}

@media (max-width: 920px) {
  .top-bar,
  .panel-heading,
  .detail-head,
  .profile-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-cluster-link {
    margin-left: 0;
  }

  .panel-heading p {
    text-align: left;
    max-width: none;
  }

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

  .dashboard-toolbar {
    align-items: stretch;
  }

  .detail-toolbar,
  .profile-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .detail-tab-parent,
  .profile-tab-parent {
    margin-left: 0;
  }

  .add-sensor-grid,
  .add-sensor-form-grid,
  .add-sensor-coordinate-grid {
    grid-template-columns: 1fr;
  }

  .add-sensor-map-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-field:last-child:nth-child(odd) {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px;
  }

  .top-bar,
  .overview-panel,
  .locations-panel,
  .detail-main-card,
  .detail-side-card,
  .trend-card,
  .detail-missing,
  .profile-panel,
  .page-content-panel {
    padding: 14px;
    border-radius: 14px;
  }

  .brand-cluster,
  .sensor-card__header,
  .map-overlay__header {
    gap: 12px;
  }

  .brand-logo {
    width: 168px;
  }

  .sensor-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }

  .add-sensor-button {
    width: 38px;
    height: 38px;
    margin-bottom: 0;
    margin-right: 4px;
  }

  .metric-grid--compact,
  .detail-stat-grid,
  .detail-side-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .map-surface {
    width: 100%;
    height: 54vh;
    min-height: 320px;
  }

  .map-overlay-slot {
    align-items: flex-start;
    padding: 10px;
  }

  .map-overlay {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .tab-button,
  .tab-button--selected {
    min-width: 0;
    width: calc(50% - 7px);
  }

  .user-cluster {
    width: 100%;
  }

  .user-meta {
    justify-items: start;
  }

  .metric-grid--compact,
  .detail-stat-grid,
  .detail-side-metrics {
    grid-template-columns: 1fr;
  }

  .detail-stat-grid--grouped {
    grid-template-columns: 1fr;
  }

  .sensor-card {
    min-height: 0;
  }

  .sensor-card__title {
    min-height: 0;
  }

  .map-surface {
    width: 100%;
    height: 48vh;
    min-height: 280px;
  }

  .map-zoom-controls {
    top: 10px;
    left: 10px;
    gap: 6px;
  }

  .map-zoom-button {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 1rem;
  }

  .map-marker {
    width: 34px;
    height: 34px;
  }
}

.top-bar__right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.top-nav__link {
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  color: var(--text-soft);
  background: rgba(17, 23, 34, 0.7);
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.top-nav__link:hover,
.top-nav__link--active {
  color: var(--text-main);
  border-color: var(--border-strong);
  background: rgba(31, 42, 60, 0.95);
}

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

.top-bar__logout,
.top-bar__signin,
.auth-inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(17, 23, 34, 0.88);
  color: var(--text-main);
}

.top-bar__logout {
  cursor: pointer;
}

.app-alert {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
}

.app-alert--info {
  background: rgba(44, 100, 255, 0.16);
  border-color: rgba(123, 148, 255, 0.34);
  color: #d7e2ff;
}

.app-alert--success {
  background: rgba(63, 198, 168, 0.12);
  border-color: rgba(63, 198, 168, 0.32);
  color: #d5fff4;
}

.app-alert--error {
  background: rgba(230, 122, 115, 0.14);
  border-color: rgba(230, 122, 115, 0.36);
  color: #ffe0dd;
}

.app-alert--warning {
  background: rgba(228, 171, 82, 0.14);
  border-color: rgba(228, 171, 82, 0.36);
  color: #ffe9c7;
}

.auth-page {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 126px);
}

.auth-panel {
  width: min(640px, 100%);
  display: grid;
  gap: 20px;
}

.auth-panel__copy {
  display: grid;
  gap: 10px;
}

.auth-panel__copy h2 {
  margin: 0;
}

.auth-panel__description {
  max-width: 52ch;
}

.auth-form-grid {
  display: grid;
  gap: 12px;
}

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

.profile-stack {
  display: grid;
  gap: 12px;
}

.profile-summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 18px;
}

.metric-tile--profile {
  min-height: 88px;
}

.profile-checklist {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(17, 23, 34, 0.7);
}

.admin-section {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.admin-table-shell {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: rgba(11, 17, 27, 0.75);
}

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

.admin-table__header,
.admin-table__cell {
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
}

.admin-table__header {
  color: var(--text-soft);
  background: rgba(31, 42, 60, 0.72);
  border-bottom: 1px solid var(--border-color);
}

.admin-table__cell {
  border-bottom: 1px solid rgba(164, 179, 201, 0.14);
}

.admin-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-action-button {
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  cursor: pointer;
  color: var(--text-main);
  background: rgba(17, 23, 34, 0.86);
}

.admin-action-button--primary {
  border-color: rgba(63, 198, 168, 0.44);
  background: rgba(63, 198, 168, 0.14);
}

.admin-action-button--secondary {
  border-color: rgba(164, 179, 201, 0.36);
  background: rgba(164, 179, 201, 0.08);
}

.admin-action-button--info {
  border-color: rgba(123, 148, 255, 0.42);
  background: rgba(123, 148, 255, 0.12);
}

.admin-action-button--danger {
  border-color: rgba(230, 122, 115, 0.44);
  background: rgba(230, 122, 115, 0.12);
}

.admin-role-display__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.admin-role-display__box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  color: var(--text-soft);
}

.admin-role-display__input {
  margin: 0;
}

@media (max-width: 920px) {
  .top-bar__right,
  .top-bar__identity,
  .top-nav,
  .auth-footer {
    width: 100%;
    justify-content: flex-start;
  }
}
