/* start main.css  */

/* Light Theme (Plain Text) */
:root {
  --primary-color: #78bd4f;
  --text-dark: #212121;
  --text-light: #757575;
  --background: #f5f5f5;
  --card-bg: #ffffff;
  --border-color: #e0e0e0;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --error-red: #ff3c3c;
  --toggle-off: #ff3c3c;
  --toggle-on: #78bd4f;
  --card-title-color: #2f4852;
  --green-text: #78bd4f;
  --label-size: 16px;
  --label-weight: 800;
}

body {
  font-family: "Noto Sans SC", sans-serif;
}

body.light-theme .card-title,
body.light-theme .page-title,
body.light-theme .sectiontitle,
body.light-theme .section-title {
  color: var(--text-dark);
}

body.light-theme .card-header {
  border-bottom: 1px solid var(--border-color);
}

body.light-theme {
  background: var(--background);
  color: var(--text-dark);
}

/* Global reset already present later; removed duplicate */
/* Full width card for the last row */
/* .dashboard > .card:last-child {
    grid-column: 1 / -1;
} */
/* Background defined on html, body below; removed duplicate body background */
/* NetData Style Live Dashboard Theme */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px !important;
}

html,
body {
  font-family: 'Inter', "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  padding: 0;
  margin: 0;
  min-height: 100vh;
  position: relative;
  overflow-x: clip;
}

@keyframes shimmer {

  0%,
  100% {
    transform: translateX(-100%);
  }

  50% {
    transform: translateX(100%);
  }
}

.title {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  color: #ffffff;
  margin-bottom: 25px;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  background: linear-gradient(135deg, #ffffff 0%, #0284c7 50%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleGlow 4s ease-in-out infinite;
}

@keyframes titleGlow {

  0%,
  100% {
    filter: brightness(1) drop-shadow(0 0 10px rgba(79, 172, 254, 0.3));
  }

  50% {
    filter: brightness(1.2) drop-shadow(0 0 20px rgba(79, 172, 254, 0.6));
  }
}

/* navigation */
.header {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 20px 0;
}

.brand-logo-img {
  max-width: 200px;
  width: 100%;
  height: auto;
  /* Keeps aspect ratio */
  display: block;
}



/* Enhanced Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  backdrop-filter: blur(10px);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  box-shadow: 0 4px 12px rgba(79, 172, 254, 0.5);
}

.page-loading {
  text-align: center;
  padding: 24px 0;
  font-size: 16px;
  font-weight: 600;
  color: #777;
}

.page-loading .fa-spinner {
  margin-right: 8px;
}

/* Hide number input arrows (Chrome, Edge, Safari) */
.no-spinner::-webkit-outer-spin-button,
.no-spinner::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Hide arrows in Firefox */
.no-spinner[type=number] {
  -moz-appearance: textfield;
}


/* UPDATED: Dashboard grid with 2 columns */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 15px;
  width: 100%;
}

body.light-theme .gauge-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 15px var(--shadow-color);
}

body.light-theme .gauge-inner {
  background: white;
}

body.light-theme .gauge-title {
  color: var(--dark-green);
}

body.light-theme .gauge-value {
  color: var(--text-dark);
}

body.light-theme .gauge-unit {
  color: var(--text-light);
}

body.light-theme .gauge-range {
  color: var(--text-light);
}

body.light-theme .gauge-address {
  color: var(--dark-green);
  background: rgba(76, 175, 80, 0.15);
  border: 1px solid rgba(76, 175, 80, 0.3);
}

body.light-theme .gauge {
  background: conic-gradient(#ff6b6b 0deg,
      #ffd166 90deg,
      #06d6a0 180deg,
      #118ab2 270deg,
      #118ab2 360deg);
}

body.light-theme .gauge-needle {
  background: #212121;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.card {
  background: #ffffff;
  background: linear-gradient(145deg, #ffffff 0%, #f9fbfd 100%);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px -5px rgba(0, 50, 90, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  min-height: 280px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #78bd4f 0%, #78bd4f 40%, #78bd4f 80%, #9be06e 100%);
  opacity: 0.95;
  transition: opacity 0.3s ease;
}

.card-between {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -10px rgba(120, 189, 79, 0.18), 0 8px 16px -4px rgba(0, 0, 0, 0.04);
  border-color: rgba(120, 189, 79, 0.4);
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.card-title-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-title-text h3 {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  line-height: 1.2;
}

.card-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-icon-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 16px;
  transition: transform 0.3s ease;
}

.card:hover .card-icon-pill {
  transform: scale(1.08);
}

.icon-primary {
  background: rgba(120, 189, 79, 0.15);
  color: #78bd4f;
}

.icon-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.icon-info {
  background: rgba(120, 189, 79, 0.12);
  color: #78bd4f;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-primary {
  background: rgba(120, 189, 79, 0.12);
  color: #5c9e37;
  border: 1px solid rgba(120, 189, 79, 0.25);
}

.badge-success {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-info {
  background: rgba(120, 189, 79, 0.1);
  color: #5c9e37;
  border: 1px solid rgba(120, 189, 79, 0.2);
}

/* Product Showcase Card Styling */
.product-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 10px;
}

.product-img-wrapper {
  width: 100%;
  max-width: 280px;
  border-radius: 12px;
  overflow: hidden;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.3s ease;
}

.product-img-wrapper:hover {
  transform: scale(1.02);
}

.product-img-wrapper img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.product-badge-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}

/* Table Controls */
.modern-control-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.cell-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(120, 189, 79, 0.12);
  color: #78bd4f;
  font-size: 12px;
}

.address-badge {
  display: none !important;
}

.metric-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(120, 189, 79, 0.12);
  color: #78bd4f;
  font-size: 12px;
}


/* Enhanced Table Styles */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  border-radius: 10px;
  overflow: hidden;
}

th,
td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
}

th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 2px solid #e2e8f0;
}

tr {
  transition: background-color 0.2s ease;
}

tr:nth-child(even) {
  background-color: #fafafa;
}

tr:hover {
  background-color: #f1f5f9;
}

tr:last-child td {
  border-bottom: none;
}

td {
  color: #334155;
  font-weight: 500;
}

/* Dark theme overrides for tables */
body.dark-theme table th {
  background: #1e293b;
  color: #cbd5e1;
  border-bottom-color: #334155;
}

body.dark-theme table td {
  color: #e2e8f0;
  border-bottom-color: #1e293b;
}

body.dark-theme tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.02);
}

body.dark-theme tr:hover {
  background-color: rgba(255, 255, 255, 0.06);
}


/* Enhanced Parameter symbols */
.param-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 163, 224, 0.2);
  text-align: center;
  line-height: 24px;
  margin-right: 8px;
  font-size: 12px;
  border: 1px solid rgba(0, 163, 224, 0.3);
}

.temp-symbol {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  border-color: rgba(231, 76, 60, 0.3);
}

.fan-symbol {
  background: rgba(52, 152, 219, 0.2);
  color: #3498db;
  border-color: rgba(52, 152, 219, 0.3);
}

.water-symbol {
  background: rgba(41, 128, 185, 0.2);
  color: #2980b9;
  border-color: rgba(41, 128, 185, 0.3);
}

.flow-symbol {
  background: rgba(155, 89, 182, 0.2);
  color: #9b59b6;
  border-color: rgba(155, 89, 182, 0.3);
}

.power-symbol {
  background: rgba(243, 156, 18, 0.2);
  color: #f39c12;
  border-color: rgba(243, 156, 18, 0.3);
}

.press-symbol {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
  border-color: rgba(46, 204, 113, 0.3);
}

.valve-symbol {
  background: rgba(230, 126, 34, 0.2);
  color: #e67e22;
  border-color: rgba(230, 126, 34, 0.3);
}

.capacity-symbol {
  background: rgba(149, 165, 166, 0.2);
  color: #95a5a6;
  border-color: rgba(149, 165, 166, 0.3);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .card {
    padding: 15px;
    min-height: 250px;
  }

  .card-title {
    font-size: 16px;
  }

  th,
  td {
    padding: 10px 8px;
    font-size: 13px;
  }

  .nav-tabs {
    font-size: 12px;
  }

  .tab {
    padding: 8px 12px;
  }

  .address {
    font-size: 11px;
    padding: 3px 6px;
  }

  .param-symbol {
    width: 20px;
    height: 20px;
    line-height: 20px;
    font-size: 10px;
  }

  .indicator {
    gap: 6px;
  }

  .indicator-dot {
    width: 8px;
    height: 8px;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .toggle-switch {
    width: 45px;
    height: 24px;
  }

  .container {
    padding: 0 10px;
  }

  .card {
    padding: 12px;
    min-height: 200px;
  }

  .card-title {
    font-size: 14px;
  }

  th,
  td {
    padding: 8px 6px;
    font-size: 12px;
  }

  /* .scrollable {
    max-height: 200px;
  } */
  .slider:before {
    height: 18px;
    width: 18px;
  }

  input:checked+.slider:before {
    transform: translateX(21px);
  }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 600px) {
  .card {
    min-height: 200px;
  }

  .scrollable {
    max-height: 150px;
  }
}

.panel-title {
  font-size: 24px;
  /* color: var(--card-title-color); */
  display: flex;
  align-items: center;
  gap: 12px;
}

/* dials */

/* Modern Gauge System */
.gauge-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.gauge-card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 163, 224, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.gauge-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(120, 189, 79, 0.15);
  border-color: rgba(120, 189, 79, 0.35);
}

.gauge-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.gauge-title {
  font-size: 13px;
  font-weight: 600;
  color: #546e7a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gauge-address {
  display: none !important;
}

.gauge-component {
  margin: 10px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}

/* Status Circle (Ring Gauge) */
.status-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  position: relative;
  background: #f0f2f5;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--primary-color) 0deg, #f0f2f5 0deg);
  mask: radial-gradient(transparent 58%, black 60%);
  -webkit-mask: radial-gradient(transparent 58%, black 60%);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-center {
  width: 75%;
  height: 75%;
  background: white;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  z-index: 2;
}

.gauge-value-text {
  font-size: 18px;
  font-weight: 700;
  color: #263238;
}

.gauge-unit-text {
  font-size: 11px;
  color: #78909c;
  margin-top: 2px;
}

/* Pressure Gauge (Analog Style) */
.pressure-gauge {
  width: 130px;
  height: 120px;
  /* Increased to fit info */
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pressure-gauge .dial-container {
  width: 130px;
  height: 85px;
  position: relative;
  overflow: hidden;
}

.pressure-gauge .dial {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: #fafafa;
  position: absolute;
  top: 0;
  left: 0;
  border: 1px solid #e0e0e0;
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.03);
}

.pressure-gauge .needle {
  width: 2px;
  height: 55px;
  background: #78bd4f;
  position: absolute;
  top: 10px;
  /* Base will be at top + height = 65px (center of 130px dial) */
  left: calc(50% - 1px);
  transform-origin: bottom center;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 3;
}

.pressure-gauge .needle::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: -3px;
  width: 8px;
  height: 8px;
  background: #37474f;
  border-radius: 50%;
}

.pressure-gauge .ticks {
  position: absolute;
  width: 100%;
  height: 100%;
}

.pressure-gauge .tick {
  position: absolute;
  width: 1px;
  height: 6px;
  background: #cfd8dc;
  left: 50%;
  transform-origin: 0 65px;
}

.pressure-gauge-info {
  margin-top: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Thermometer (Liquid Style) */
.thermometer-wrapper {
  height: 110px;
  display: flex;
  align-items: flex-end;
  gap: 15px;
}

.thermometer {
  width: 16px;
  height: 100%;
  background: #f1f3f4;
  border-radius: 10px;
  position: relative;
  border: 1px solid #e0e0e0;
  overflow: hidden;
}

.thermo-mercury {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: linear-gradient(to top, #5c9e37, #78bd4f, #9be06e);
  border-radius: 10px;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.thermometer-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

/* Flow Gauge (Animated Bar) */
.flow-gauge {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Ensure centering */
  gap: 12px;
}

.flow-bar {
  width: 150px;
  /* Fixed width for consistency */
  height: 16px;
  background: #f1f3f4;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  border: 1px solid #e0e0e0;
}

.flow-water {
  height: 100%;
  background: linear-gradient(90deg, #5c9e37, #78bd4f);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.flow-water::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent);
  animation: flowWave 2s linear infinite;
}

@keyframes flowWave {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}


/* Status Indicator (On/Off Pill) */
.status-indicator-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.status-pill {
  padding: 8px 24px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.4s ease;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.status-pill.on {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: white;
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.status-pill.off {
  background: #f1f3f4;
  color: #90a4ae;
}

/* Level Gauge (Tank Style) */
.level-gauge-wrapper {
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.level-tank {
  width: 60px;
  height: 90px;
  background: rgba(241, 243, 244, 0.8);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 4px 8px rgba(0, 0, 0, 0.05),
    0 2px 5px rgba(0, 0, 0, 0.02);
}

.level-markers {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 0;
  z-index: 2;
  pointer-events: none;
}

.level-marker {
  width: 100%;
  height: 1px;
  background: rgba(0, 0, 0, 0.05);
  position: relative;
}

.level-marker::after {
  content: attr(data-label);
  position: absolute;
  right: 100%;
  top: -6px;
  font-size: 8px;
  color: #90a4ae;
  margin-right: 4px;
}

.level-fill {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: linear-gradient(to top, #0288d1, #29b6f6);
  transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.level-fill::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: rgba(255, 255, 255, 0.2);
  filter: blur(2px);
}

.level-text {
  font-size: 14px;
  font-weight: 700;
  color: #37474f;
  background: #f8f9fa;
  padding: 2px 10px;
  border-radius: 4px;
  border: 1px solid #eee;
}


/* .gauge-value {
  font-size: 16px;
  font-weight: bold;
  color: #e0e1dd;
  line-height: 1.1;
  margin-bottom: 2px;
} */

.gauge-unit,
.temperature-unit,
.flow-unit,
.pressure-unit {
  font-size: 10px;
  /* Reduced from 12px */
  color: #7f8c8d;
  line-height: 1;
}

.gauge-needle {
  position: absolute;
  width: 2px;
  height: 52px;
  /* Slightly shorter */
  background: #e0e1dd;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(0deg);
  border-radius: 2px 2px 0 0;
  z-index: 5;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.7);
}

.gauge-range {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 10px;
  /* Smaller font */
  color: #7f8c8d;
  margin-top: 8px;
  /* Reduced margin */
}

/* Light theme adjustments for smaller gauges */
body.light-theme .gauge-card {
  background: var(--card-bg) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 3px 10px var(--shadow-color) !important;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 1024px) {

  .gauge-container,
  .gauge-container-second-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {

  .gauge-container,
  .gauge-container-second-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .gauge-card {
    padding: 10px;
  }

  .gauge-title {
    font-size: 12px;
  }

  .gauge {
    width: 90px;
    height: 90px;
  }

  .gauge-inner {
    width: 60px;
    height: 60px;
    top: 15px;
    left: 15px;
    padding: 3px;
  }

  .gauge-value {
    font-size: 14px;
  }

  .gauge-unit {
    font-size: 9px;
  }

  .gauge-needle {
    height: 45px;
  }
}

.products-logo {
  max-width: 100%;
  height: auto;
  display: block;
}

.product-info-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Sidebar styling */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 64px;
  box-sizing: border-box;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.brand-logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  letter-spacing: 0.5px;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.collapse-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.collapse-btn:hover {
  background: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.close-btn {
  font-size: 24px;
  color: #94a3b8;
  cursor: pointer;
  display: none;
  line-height: 1;
}

.close-btn:hover {
  color: #f43f5e;
}

.sidebar-nav-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px;
}

/* Custom scrollbar for sidebar nav */
.sidebar-nav-container::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav li a {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  color: #94a3b8;
  text-decoration: none !important;
  border-radius: 10px;
  font-size: 14px !important;
  font-weight: 500 !important;
  font-family: 'Inter', sans-serif !important;
  line-height: 1.4 !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  position: relative;
}

.sidebar-nav li a i {
  font-size: 17px !important;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.sidebar-nav li a span {
  font-size: 14px !important;
  font-weight: 500 !important;
  font-family: 'Inter', sans-serif !important;
  transition: opacity 0.2s ease;
}

.sidebar-nav li a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  transform: translateX(2px);
}

.sidebar-nav li a:hover i {
  color: #78bd4f;
  transform: scale(1.1);
}

.sidebar-nav li a.active {
  background: linear-gradient(90deg, rgba(120, 189, 79, 0.22) 0%, rgba(120, 189, 79, 0.08) 100%);
  color: #78bd4f;
  font-weight: 600;
  border-left: 3px solid #78bd4f;
  box-shadow: 0 4px 12px rgba(120, 189, 79, 0.15);
}

.sidebar-nav li a.active i {
  color: #78bd4f;
}

/* Collapsed Desktop State */
.sidebar.collapsed {
  width: 72px;
}

.sidebar.collapsed .brand-title {
  display: none;
  opacity: 0;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 16px 8px;
}

.sidebar.collapsed .brand-wrapper {
  justify-content: center;
}

.sidebar.collapsed .brand-logo-img {
  margin: 0;
}

.sidebar.collapsed .collapse-btn i {
  transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-nav li a {
  justify-content: center;
  padding: 12px 0;
  border-left: none;
}

.sidebar.collapsed .sidebar-nav li a span {
  display: none;
}

/* Tooltips in Collapsed Desktop Mode */
.sidebar.collapsed .sidebar-nav li a::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 82px;
  top: 50%;
  transform: translateY(-50%);
  background: #0f172a;
  color: #f8fafc;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1100;
}

.sidebar.collapsed .sidebar-nav li a:hover::after {
  opacity: 1;
  visibility: visible;
  left: 76px;
}

/* Top Hamburger Trigger Button */
.hamburger {
  font-size: 1.2rem;
  color: #f8fafc;
  position: fixed;
  top: 16px;
  left: 16px;
  cursor: pointer;
  z-index: 1040;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.hamburger:hover {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
  transform: scale(1.05);
}

/* Backdrop for Mobile */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1045;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Main Content Adjustments */
.main-content {
  margin-left: 260px;
  padding: 0;
  min-height: 100vh;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

body.sidebar-collapsed .main-content {
  margin-left: 72px;
}

/* Page inner content padding when topbar is sticky */
.pagebody {
  padding: 20px 24px 24px 24px;
  flex: 1;
}

.card-between,
.upgrade-component {
  padding: 20px 24px 24px 24px;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .main-content {
    margin-left: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
  }

  body.sidebar-collapsed .main-content {
    margin-left: 0 !important;
  }

  .pagebody,
  .card-between,
  .upgrade-component {
    padding: 14px 16px 16px 16px;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 280px !important;
    z-index: 1050;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar .collapse-btn {
    display: none;
  }

  .sidebar .close-btn {
    display: flex;
  }

  .sidebar .brand-title {
    display: block !important;
    opacity: 1 !important;
  }

  .sidebar-nav li a span {
    display: inline !important;
  }

  .sidebar.collapsed .sidebar-nav li a::after {
    display: none;
  }
}

.menu-title {
  font-weight: bold;
  margin-top: 10px;
}

.caret {
  float: right;
  transition: transform 0.3s;
}

.active>.menu-header .caret {
  transform: rotate(90deg);
}

/* status indicator */

.variable-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

.status-ok {
  background-color: var(--ok);
}

.status-off {
  background-color: var(--error);
}

.status-idle {
  background-color: #ccc;
}

/* Toggle Switch */
.toggle-switch {
  width: 50px;
  height: 26px;
  background-color: #bbb;
  border-radius: 26px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: inline-block;
  vertical-align: middle;
}

.toggle-thumb {
  width: 22px;
  height: 22px;
  background-color: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.3s ease;
}

.toggle-switch.on {
  background-color: #4caf50;
}

.toggle-switch.on .toggle-thumb {
  transform: translateX(24px);
}

.switch-cell {
  text-align: center;
}

/* ---------- General Input Styling ---------- */
.op-input,
.op-select {
  width: 100%;
  padding: 10px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  background-color: #fffdf9;
  transition: all 0.2s ease-in-out;
}

.op-input:focus,
.op-select:focus {
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
  background-color: #ffffff;
}

.op-input:hover,
.op-select:hover {
  border-color: #999;
}

/* Device variable */

/* Text Input */
.devicevariable-input {
  width: 90px;
  height: 32px;
  font-size: 14px;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
}

.devicevariable-input:focus {
  border-color: #007acc;
  box-shadow: 0 0 4px rgba(0, 122, 204, 0.4);
}

/* Checkbox */
.devicevariable-checkbox {
  width: 20px;
  height: 20px;
  transform: scale(1.3);
  cursor: pointer;
}

/* Button */
/* .devicevariable-button {
  background-color: #007acc;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
} */

/* .devicevariable-button:hover:not(:disabled) {
  background-color: #005f9e;
}

.devicevariable-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
} */

.devicevariable-set-btn {
  padding: 0 14px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  background: var(--primary-color, #007bff);
  color: #fff;
  cursor: pointer;
}

.devicevariable-set-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.disabled-input {
  opacity: 0.5;
  pointer-events: none;
}

.devicevariable-csv-export {
  display: flex;
  justify-content: flex-end;
}

.devicevariable-export-button {
  width: auto;
  padding: 10px 20px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 10px;
}

/* upgrade */

.upgrade-component {
  background: #fff;
}

.upgrade-component .panel {
  border: 1px solid #ccc;
  border-radius: 4px;
}

.upgrade-component .panel-primary>.panel-heading {
  background-color: #337ab7;
  border-color: #0056a3;
  color: #fff;
  font-weight: bold;
  font-size: 15px;
  padding: 10px 15px;
}

.upgrade-component .panel-body {
  padding: 20px;
}

.upgrade-component label {
  font-size: 14px;
  display: block;
  margin-bottom: 8px;
  color: #337ab7;
}

/* File upload layout */
.upgrade-component .file-upload {
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 15px;
}

.upgrade-component .file-path {
  flex: 1;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  height: 38px;
  border-radius: 4px 0 0 4px;
  padding: 6px 10px;
  font-size: 13px;
  color: #555;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upgrade-component .btn-choose {
  background-color: #337ab7;
  border-color: #2e6da4;
  color: #fff;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  height: 38px;
  display: flex;
  align-items: center;
  margin-top: 6px;
}

.upgrade-component .btn-choose:hover {
  background-color: #286090;
  border-color: #204d74;
}

.upgrade-component input[type="file"] {
  display: none;
}

.upgrade-component .btn-upgrade {
  background-color: #337ab7;
  border-color: #2e6da4;
  font-size: 13px;
  color: white;
  padding: 8px 18px;
  border-radius: 4px;
}

.upgrade-component .btn-upgrade:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: black;
}


.upgrade-component .progress {
  height: 14px;
  margin-top: 15px;
  display: none;
}

.upgrade-component .progress-text {
  margin-top: 10px;
  font-size: 13px;
  font-weight: bold;
  color: #333;
}

.connect-btn-wrapper {
  margin-top: 20px;
  text-align: left;
}

.connect-btn {
  padding: 10px 16px;
  background-color: rgba(44, 62, 80, 0.8);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.connect-btn:hover {
  background: #005dc1;
}

/* DateTime */

/* Apply Button */
.devicevariable-button {
  width: 100%;
  padding: 12px 20px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 15px;
}

.devicevariable-button:hover {
  background: #66a341;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(120, 189, 79, 0.35);
}

.input-row {
  display: flex;
  gap: 20px;
  width: 100%;
}

/* Make each column align nicely */
.input-column {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Fix input widths */
.devicevariable-input {
  width: 100%;
  height: 40px;
  box-sizing: border-box;
}

.devicevariable-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(120, 189, 79, 0.3);
  background: white;
  outline: none;
}

/* datalog */

.data-log-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.data-log-section label {
  margin: 0 !important;
}

.data-log-section input,
.data-log-section select {
  min-width: 160px;
}

#logTable {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#logChart {
  display: block;
  width: 100%;
  height: 420px;

  max-width: 100%;
  overflow: hidden;
}

@media (max-width: 1200px) {
  #logChart {
    height: 360px;
  }
}

@media (max-width: 900px) {
  #logChart {
    height: 300px;
  }
}

@media (max-width: 700px) {
  #logChart {
    height: 240px;
  }
}

@media (max-width: 500px) {
  #logChart {
    height: 200px;
  }
}

#trendDashboard.trend-chart-dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.trend-chart-card {
  min-height: 0;
}

.trend-chart-shell {
  position: relative;
  width: 100%;
  height: 340px;
  margin-top: 12px;
}

.trend-latest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.trend-latest-item {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(47, 72, 82, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
}

.trend-latest-label {
  display: block;
  overflow: hidden;
  color: #2f4852;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-latest-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 6px;
  color: #111;
  font-family: "Courier New", Consolas, monospace;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.trend-latest-unit {
  color: #555;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 700px) {
  .trend-chart-shell {
    height: 280px;
  }

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

/* Modern Status & Navigation Tabs */
.tab-wrapper {
  display: flex;
  gap: 12px;
  background: rgba(241, 245, 249, 0.8);
  padding: 6px;
  border-radius: 14px;
  margin-bottom: 24px;
  border: 1px solid #e2e8f0;
  width: fit-content;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}

.tab:hover {
  color: #78bd4f;
  background: rgba(255, 255, 255, 0.6);
}

.tab.active {
  background: #ffffff;
  color: #5c9e37;
  box-shadow: 0 4px 12px rgba(120, 189, 79, 0.12);
  border-color: rgba(120, 189, 79, 0.3);
}


.control-page {
  width: 100%;
  height: calc(100vh - 60px);
  /* adjust if header height differs */
  /* Use path relative to this CSS file to work with different server roots. */
  background-image: url("./imgs/INVCDU150.jpeg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

/* Optional overlay for text/buttons */
.control-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: rgba(0, 0, 0, 0.25);
  /* optional dark overlay */
}

.page-container--pid {
  width: 100%;
  height: calc(100vh - 118px);
  min-height: 640px;
}

.pid-diagram-page {
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
}

.pid-native-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 2px solid #168f90;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(236, 240, 238, 0.96)),
    linear-gradient(90deg, rgba(47, 72, 82, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(47, 72, 82, 0.05) 1px, transparent 1px);
  background-size: auto, 36px 36px, 36px 36px;
  box-shadow: 0 10px 24px rgba(47, 72, 82, 0.12);
}

.pid-pipe-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pid-pipe {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 8;
  filter: drop-shadow(0 1px 1px rgba(47, 72, 82, 0.18));
}

.pid-pipe--thin {
  stroke-width: 5;
}

.pid-pipe--dashed {
  stroke-dasharray: 4 8;
}

.pid-pipe--green {
  stroke: #8cc954;
}

.pid-pipe--orange {
  stroke: #ee8a24;
}

.pid-pipe--red {
  stroke: #d81717;
}

.pid-leader {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  opacity: 0.78;
}

.pid-leader--green {
  stroke: #8cc954;
}

.pid-leader--orange {
  stroke: #e5a06a;
}

.pid-leader--red {
  stroke: #d81717;
}

.pid-marker--green {
  fill: #8cc954;
}

.pid-marker--orange {
  fill: #ee8a24;
}

.pid-marker--red {
  fill: #d81717;
}

.pid-sensor {
  fill: rgba(255, 255, 255, 0.92);
  stroke-width: 4;
}

.pid-sensor--green {
  stroke: #8cc954;
}

.pid-sensor--orange {
  stroke: #ee8a24;
}

.pid-sensor--red {
  stroke: #d81717;
}

.pid-sensor-icon {
  color: #8cc954;
  pointer-events: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pid-sensor-icon--green {
  color: #7fc44b;
}

.pid-sensor-icon--orange {
  color: #d98328;
}

.pid-sensor-icon--red {
  color: #d81717;
}

.pid-equipment {
  position: absolute;
  z-index: 2;
  border: 4px solid #8cc954;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 10px rgba(47, 72, 82, 0.12);
}

.pid-reservoir {
  left: 62.5%;
  top: 9.5%;
  width: 6.8%;
  height: 7.5%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-width: 3px;
  color: #2f4852;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.12;
  text-align: center;
}

.pid-heat-exchanger {
  left: 26.1%;
  top: 24.0%;
  width: 9.5%;
  height: 36.0%;
  border-left-color: #ee8a24;
  border-right-color: #8cc954;
}

.pid-exchanger-line {
  position: absolute;
  left: 48%;
  top: 4%;
  width: 8px;
  height: 92%;
  border-radius: 4px;
  background: #8cc954;
  transform-origin: center;
}

.pid-exchanger-line--a {
  background: linear-gradient(180deg, #8cc954 0%, #ee8a24 48%, #d81717 100%);
  transform: rotate(32deg);
}

.pid-exchanger-line--b {
  background: linear-gradient(180deg, #d81717 0%, #ee8a24 48%, #8cc954 100%);
  transform: rotate(-32deg);
}

.pid-pump-bank {
  left: 47.8%;
  top: 47.5%;
  width: 13.5%;
  height: 20%;
}

.pid-pump {
  position: absolute;
  left: 50%;
  width: 47px;
  height: 47px;
  margin-left: -24px;
  border: 4px solid #8cc954;
  border-radius: 50%;
  background: #fff;
}

.pid-pump::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 9px;
  width: 22px;
  height: 22px;
  border: 4px solid #8cc954;
  border-left-color: transparent;
  border-radius: 50%;
  transform: rotate(-28deg);
}

.pid-pump::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 13px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid #8cc954;
  transform: rotate(-20deg);
}

.pid-pump--top {
  top: -25px;
}

.pid-pump--bottom {
  bottom: -25px;
}

.pid-filter-bank {
  left: 64.5%;
  top: 47.5%;
  width: 9.2%;
  height: 20%;
}

.pid-filter-bank .pid-filter {
  position: absolute;
  left: 50%;
  width: 45px;
  height: 38px;
  margin-left: -22px;
  border: 4px solid #8cc954;
  border-radius: 20px;
  background: #fff;
}

.pid-filter-bank .pid-filter::before,
.pid-filter-bank .pid-filter::after {
  content: "";
  position: absolute;
  top: 12px;
  width: 13px;
  height: 10px;
  border: 3px solid #8cc954;
  background: #fff;
}

.pid-filter-bank .pid-filter::before {
  left: 4px;
}

.pid-filter-bank .pid-filter::after {
  right: 4px;
}

.pid-filter--top {
  top: -18px;
}

.pid-filter--bottom {
  bottom: -18px;
}

.pid-instrument {
  position: absolute;
  left: var(--pid-x);
  top: var(--pid-y);
  z-index: 5;
  display: grid;
  grid-template-rows: 18px 22px;
  width: var(--pid-w);
  min-width: 72px;
  max-width: 11%;
  overflow: hidden;
  border: 1px solid rgba(47, 72, 82, 0.35);
  border-radius: 4px;
  color: #111;
  background-clip: padding-box;
  box-shadow: 0 3px 8px rgba(47, 72, 82, 0.12);
  pointer-events: none;
}

.pid-instrument__label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pid-instrument__readout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  border-top: 1px solid rgba(47, 72, 82, 0.25);
  background: rgba(255, 255, 255, 0.82);
  font-family: "Courier New", Consolas, monospace;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.pid-instrument__readout>span:first-child {
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pid-instrument__unit {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 11px;
  font-weight: 700;
}

.pid-instrument--green {
  background: #9fd266;
}

.pid-instrument--orange {
  background: #f59a2e;
}

.pid-instrument--red {
  background: #ef2424;
}

.pid-schematic-layer {
  position: absolute;
  inset: 0 0 16% 0;
  z-index: 2;
  overflow: hidden;
}

.pid-ambient-panel {
  position: absolute;
  left: 2.5%;
  bottom: 2.5%;
  z-index: 6;
  width: 34%;
  border: 1px solid rgba(47, 72, 82, 0.2);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 12px rgba(47, 72, 82, 0.10);
}

.pid-ambient-panel h3 {
  margin: 0;
  padding: 4px 8px;
  background: #8cc954;
  color: #111;
  font-size: 21px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
}

.pid-panel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.pid-panel-cell {
  min-width: 0;
  border-right: 1px solid rgba(47, 72, 82, 0.16);
  border-bottom: 1px solid rgba(47, 72, 82, 0.16);
  background: rgba(255, 255, 255, 0.72);
}

.pid-panel-cell:nth-child(3n) {
  border-right: 0;
}

.pid-panel-cell__label {
  display: block;
  padding: 4px 4px 2px;
  overflow: hidden;
  color: #2f4852;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pid-panel-cell__value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 24px;
  font-family: "Courier New", Consolas, monospace;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.pid-panel-cell__unit {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.pid-status-panel {
  position: absolute;
  right: 2.5%;
  bottom: 2.5%;
  z-index: 6;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 20%;
  border: 1px solid rgba(47, 72, 82, 0.18);
  background: rgba(255, 255, 255, 0.90);
  box-shadow: 0 4px 12px rgba(47, 72, 82, 0.10);
}

.pid-status-panel .pid-panel-cell {
  border-bottom: 0;
}

/* Group Control Tabular View */
.group-control-table-card {
  grid-column: 1 / -1;
  /* Full width */
  margin-top: 20px;
}

.group-control-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.group-control-table th {
  background-color: var(--primary-color);
  color: white;
  padding: 12px;
  text-align: center;
  font-size: 14px;
  white-space: nowrap;
}

.group-control-table td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.group-control-table tr:hover {
  background-color: rgba(0, 163, 224, 0.05);
}

/* Status Indicators */
.status-running {
  color: #2ecc71;
  font-weight: bold;
}

.status-standby {
  color: #f39c12;
  font-weight: bold;
}

.status-unit-off {
  color: #95a5a6;
}

.status-fault {
  color: #e74c3c;
  font-weight: bold;
}

.status-online {
  color: #3498db;
  font-weight: bold;
}

.status-no-group {
  color: #bdc3c7;
}

.status-na {
  color: #7f8c8d;
}

/* Status Legend Card */
.group-control-legend-card {
  grid-column: 1 / -1;
  min-height: auto !important;
  margin-top: 20px;
}

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 5px 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* Map background colors for dots */
.status-dot.status-running {
  background-color: #2ecc71;
}

.status-dot.status-standby {
  background-color: #f39c12;
}

.status-dot.status-online {
  background-color: #3498db;
}

.status-dot.status-fault {
  background-color: #e74c3c;
}

.status-dot.status-unit-off {
  background-color: #95a5a6;
}

.status-dot.status-no-group {
  background-color: #bdc3c7;
}

.status-dot.status-na {
  background-color: #7f8c8d;
}

@media (max-width: 1200px) {
  .group-control-table {
    display: block;
    overflow-x: auto;
  }
}

.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  grid-column: 1 / -1;
  /* Full width row */
  width: 100%;
  margin-bottom: 20px;
}

@media (max-width: 1024px) {
  .dashboard-row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   TOPBAR HEADER STYLES (RDHX Design System)
   ========================================================================== */

.topbar,
.top-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
  padding: 0 30px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.03), 0 1px 2px -1px rgba(15, 23, 42, 0.03);
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  transition: all 0.3s ease;
}

body.dark-theme .topbar,
body.dark-theme .top-header-bar {
  background: rgba(15, 23, 42, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.topbar-left,
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-left .mobile-hamburger-btn,
.header-left .mobile-hamburger-btn,
.topbar-left .hamburger,
.header-left .hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #475569;
  cursor: pointer;
  padding: 0;
  font-size: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar-left .mobile-hamburger-btn:hover,
.header-left .mobile-hamburger-btn:hover,
.topbar-left .hamburger:hover,
.header-left .hamburger:hover {
  background: #f8fafc;
  color: var(--primary-color, #78bd4f);
  border-color: var(--primary-color, #78bd4f);
  transform: translateY(-1px);
}

.topbar-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(120, 189, 79, 0.15) 0%, rgba(120, 189, 79, 0.05) 100%);
  border: 1px solid rgba(120, 189, 79, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color, #78bd4f);
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(120, 189, 79, 0.12);
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}

.topbar-icon:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(120, 189, 79, 0.25);
}

body.dark-theme .topbar-icon {
  background: linear-gradient(135deg, rgba(120, 189, 79, 0.25) 0%, rgba(120, 189, 79, 0.1) 100%);
  border-color: rgba(120, 189, 79, 0.35);
  color: #78bd4f;
}

.topbar-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-title {
  margin: 0;
  padding: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

body.dark-theme .topbar-title {
  color: #f8fafc;
}

.topbar-breadcrumb,
.breadcrumb-container {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  line-height: 1;
}

body.dark-theme .topbar-breadcrumb,
body.dark-theme .breadcrumb-container {
  color: #94a3b8;
}

.topbar-breadcrumb i,
.breadcrumb-container .breadcrumb-sep {
  font-size: 10px;
  opacity: 0.5;
}

.topbar-breadcrumb .active,
.breadcrumb-container .page-current {
  color: var(--primary-color, #78bd4f);
  font-weight: 600;
}

body.dark-theme .topbar-breadcrumb .active,
body.dark-theme .breadcrumb-container .page-current {
  color: #78bd4f;
}

.topbar-right,
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-badge.status-online,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 20px;
  color: #059669;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  user-select: none;
}

body.dark-theme .topbar-badge.status-online,
body.dark-theme .status-badge {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.status-dot,
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  position: relative;
  display: inline-block;
  box-shadow: none;
}

.status-dot::after,
.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.45);
  animation: statusPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes statusPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.topbar-clock,
.live-clock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  user-select: none;
}

body.dark-theme .topbar-clock,
body.dark-theme .live-clock {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.topbar-clock i,
.live-clock i {
  color: var(--primary-color, #78bd4f);
  font-size: 14px;
}

body.dark-theme .topbar-clock i,
body.dark-theme .live-clock i {
  color: #78bd4f;
}

.topbar-time,
.live-clock span {
  font-variant-numeric: tabular-nums;
  font-family: inherit;
}

.topbar-divider {
  width: 1px;
  height: 28px;
  background: #e2e8f0;
}

body.dark-theme .topbar-divider {
  background: rgba(255, 255, 255, 0.1);
}

.topbar-action-btn,
.header-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-decoration: none;
  font-size: 15px;
  cursor: pointer;
  padding: 0;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.dark-theme .topbar-action-btn,
body.dark-theme .header-btn {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.topbar-action-btn:hover,
.header-btn:hover {
  background: #f8fafc;
  color: var(--primary-color, #78bd4f);
  border-color: var(--primary-color, #78bd4f);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(120, 189, 79, 0.2);
}

body.dark-theme .topbar-action-btn:hover,
body.dark-theme .header-btn:hover {
  background: #334155;
  color: #78bd4f;
  border-color: #78bd4f;
}

.topbar-action-btn:hover i.fa-sync-alt,
.topbar-action-btn:hover i.fa-rotate,
.topbar-action-btn:hover i.fa-arrows-rotate,
.topbar-action-btn:hover i.fa-redo,
.header-btn:hover i {
  transform: rotate(180deg);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar-notif-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 6px;
  min-width: 16px;
  height: 16px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45);
  animation: badgePulse 2s infinite;
}

.topbar-notif-count.hidden {
  display: none !important;
}

@keyframes badgePulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

/* Responsive Topbar Rules */
@media (max-width: 992px) {

  .topbar,
  .top-header-bar {
    padding: 0 20px;
  }
}

@media (max-width: 768px) {

  .topbar,
  .top-header-bar {
    height: 60px;
    padding: 0 14px;
    margin-bottom: 0;
  }

  .topbar-left .mobile-hamburger-btn,
  .header-left .mobile-hamburger-btn {
    display: flex;
  }

  .topbar-breadcrumb,
  .breadcrumb-container {
    display: none;
  }

  .topbar-title {
    font-size: 16px;
  }

  .topbar-icon {
    width: 36px;
    height: 36px;
    font-size: 15px;
    border-radius: 8px;
  }

  .topbar-badge.status-online span:not(.status-dot),
  .status-badge span.status-text {
    display: none;
  }

  .topbar-badge.status-online,
  .status-badge {
    padding: 8px;
    border-radius: 50%;
  }

  .topbar-clock,
  .live-clock {
    padding: 5px 10px;
    font-size: 12px;
  }

  .topbar-action-btn,
  .header-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
}

/* Skeleton Loading State */
.skeleton-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  width: 100%;
  padding: 20px 0;
}

.skeleton-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #eaeaea;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skeleton-header {
  height: 24px;
  width: 60%;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
}

.skeleton-body {
  height: 140px;
  width: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
}

/* Mobile Hamburger Toggle Button in Top Bar */
.mobile-hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  color: #334155;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-hamburger-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #0284c7;
}

/* Scrollable Touch Tables Wrapper */
.scrollable,
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 12px;
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Optimization
   ========================================================================== */

@media (max-width: 768px) {
  .mobile-hamburger-btn {
    display: flex;
  }

  .top-header-bar {
    padding: 10px 14px;
    gap: 10px;
  }

  .header-left {
    gap: 10px;
  }

  .header-right {
    gap: 8px;
  }

  .breadcrumb-container {
    font-size: 12px;
  }

  .live-clock {
    padding: 4px 8px;
    font-size: 12px;
  }

  .status-badge {
    padding: 4px 8px;
    font-size: 11px;
  }

  .card {
    padding: 16px;
    border-radius: 12px;
  }

  .tab-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px;
    gap: 6px;
  }

  .tab {
    padding: 8px 14px;
    font-size: 12px;
    white-space: nowrap;
  }

  .dashboard {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .product-img-wrapper {
    max-width: 200px;
  }
}

@media (max-width: 480px) {

  .breadcrumb-container .system-title,
  .breadcrumb-container .breadcrumb-sep {
    display: none;
  }

  .breadcrumb-container .page-current {
    font-size: 13px;
  }

  .status-badge .status-text {
    display: none;
  }

  .status-badge {
    padding: 6px;
    border-radius: 50%;
  }

  .header-btn {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .card-badge {
    align-self: flex-start;
  }

  th,
  td {
    padding: 8px 10px;
    font-size: 12px;
  }
}

.hidden {
  display: none !important;
}

.topbar-icon {
  color: #78bd4f !important;
}

/* ==========================================================================
   GRAPHICAL VISUAL SYSTEM STATUS STYLES (status.htm)
   ========================================================================== */

.status-view-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

body.dark-theme .status-view-nav {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(51, 65, 85, 0.7);
}

.status-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-nav-btn:hover {
  background: rgba(120, 189, 79, 0.08);
  color: #78bd4f;
}

.status-nav-btn.active {
  background: linear-gradient(135deg, #78bd4f 0%, #5c9e37 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(120, 189, 79, 0.35);
}

.status-nav-btn i {
  font-size: 14px;
}

.status-visual-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.status-view-panel {
  display: none;
  flex-direction: column;
  gap: 24px;
  animation: fadeInPanel 0.35s ease forwards;
}

.status-view-panel.active {
  display: flex;
}

@keyframes fadeInPanel {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Synoptic Schematic / Hydraulic Circuit ─── */
.synoptic-schematic-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

.schematic-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
}

.schematic-circuit-wrapper {
  position: relative;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 24px;
  min-height: 460px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.schematic-loops-container {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  gap: 20px;
  align-items: center;
  position: relative;
}

@media (max-width: 992px) {
  .schematic-loops-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

.schematic-loop-box {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  border: 2px solid;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
  position: relative;
}

.fws-loop-box {
  border-color: #78bd4f;
}

.tcs-loop-box {
  border-color: #34d399;
}

.loop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.loop-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fws-loop-box .loop-title {
  color: #5c9e37;
}

.tcs-loop-box .loop-title {
  color: #059669;
}

.hex-bridge-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.hex-heat-exchanger-icon {
  width: 90px;
  height: 120px;
  background: linear-gradient(135deg, #78bd4f 0%, #10b981 100%);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(120, 189, 79, 0.25);
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.hex-plate-lines {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.hex-plate-line {
  width: 3px;
  height: 40px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 2px;
}

.hex-title-text {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ─── Metric Chips / Telemetry Badges in Schematic ─── */
.telemetry-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.telemetry-chip {
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.telemetry-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.chip-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip-value-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.chip-value {
  font-family: 'Inter', 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.chip-unit {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

/* ─── Valve & Pump Visual Components ─── */
.component-visual-bar {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 12px 16px;
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.valve-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(120, 189, 79, 0.12);
  color: #78bd4f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.pump-impeller-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 18px;
  transition: all 0.3s ease;
}

.pump-impeller-icon.running {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #059669;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
  animation: spinImpeller 1.2s linear infinite;
}

@keyframes spinImpeller {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.fan-blade-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 20px;
}

.fan-blade-icon.running {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #0284c7;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
  animation: spinImpeller 0.8s linear infinite;
}

/* ─── State Badges ─── */
.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.state-pill.online,
.state-pill.healthy,
.state-pill.on,
.state-pill.ok {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.state-pill.offline,
.state-pill.off,
.state-pill.unhealthy,
.state-pill.error,
.state-pill.trip {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.state-pill.standby,
.state-pill.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  animation: pulseDotAnim 1.6s infinite ease-in-out;
}

@keyframes pulseDotAnim {

  0%,
  100% {
    transform: scale(0.8);
    opacity: 0.6;
  }

  50% {
    transform: scale(1.3);
    opacity: 1;
  }
}

/* ─── Pump Station Grid ─── */
.pump-station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.pump-detail-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pump-detail-card:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.07);
}

.pump-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pump-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pump-gauges-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
  justify-items: center;
  background: #f8fafc;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #e2e8f0;
}

.radial-meter-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.meter-caption {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.progress-linear-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.progress-linear-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.progress-linear-track {
  height: 8px;
  border-radius: 6px;
  background: #e2e8f0;
  overflow: hidden;
  position: relative;
}

.progress-linear-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #0284c7 0%, #10b981 100%);
  transition: width 0.6s ease;
}

.pump-meta-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.meta-stat-item {
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px;
  border: 1px solid #e2e8f0;
}

.meta-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
}

.meta-stat-value {
  font-family: 'Inter', 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 2px;
}

/* ─── ATS Power Visualizer ─── */
.ats-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.ats-schematic-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  grid-column: 1 / -1;
}

.power-bus-diagram {
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  gap: 16px;
  align-items: center;
  margin: 20px 0;
  background: #f8fafc;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
  .power-bus-diagram {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.power-source-node {
  background: #ffffff;
  border-radius: 14px;
  padding: 18px;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.power-source-node.active-source {
  border-color: #10b981;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}

.power-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(2, 132, 199, 0.1);
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.power-source-node.active-source .power-icon-circle {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.ats-switch-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.switch-contactor-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #0f172a;
  color: #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.3);
}

/* ─── Water Chemistry & Environment Visuals ─── */
.chem-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.chem-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ph-spectrum-bar {
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, #ef4444 0%, #f97316 20%, #eab308 40%, #22c55e 55%, #14b8a6 70%, #3b82f6 85%, #8b5cf6 100%);
  position: relative;
  margin: 14px 0 6px 0;
}

.ph-pointer {
  position: absolute;
  top: -6px;
  transform: translateX(-50%);
  width: 14px;
  height: 26px;
  background: #0f172a;
  border: 2px solid #ffffff;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: left 0.5s ease;
}

.ph-scale-legend {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
}

/* ─── I/O Diagnostics Signal Board (LED Matrix) ─── */
.io-board-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.io-section-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.io-led-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.io-led-item {
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s ease;
}

.io-led-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #cbd5e1;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #cbd5e1;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.io-led-indicator.active-green {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.io-led-indicator.active-red {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: ledPulse 1s infinite;
}

.io-led-indicator.active-amber {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

@keyframes ledPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.io-led-text {
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  line-height: 1.2;
}

/* end main.css  */