/* IoT Cloud Portal Stylesheet */
:root {
  --portal-navy: #0f172a;
  --portal-header: #1e293b;
  --portal-blue: #2b82b9;
  --portal-primary: #0284c7;
  --portal-bg: #f8fafc;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--portal-bg);
  color: #334155;
  margin: 0;
  padding: 0;
}

.bg-navy {
  background-color: var(--portal-header) !important;
}

.text-navy {
  color: #0f172a !important;
}

.fs-xs {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
}

/* Nav Link Styling */
.navbar-dark .navbar-nav .nav-link {
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
}

.navbar-dark .navbar-nav .nav-link.active {
  color: #ffffff !important;
  background-color: var(--portal-primary) !important;
}

/* Stat Cards */
.stat-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border-radius: 8px;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08) !important;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

/* Table Header */
.table-blue-thead th {
  background-color: var(--portal-blue) !important;
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  padding: 10px 12px;
  vertical-align: middle;
}

.table td {
  padding: 10px 12px;
  font-size: 0.88rem;
}

/* Live Dot Pulse */
.live-dot {
  width: 9px;
  height: 9px;
  background-color: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulse-green 1.8s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Badges */
.badge-online {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
}

.badge-offline {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
}

/* Sensor Chart Styling */
#sensorChart {
  cursor: crosshair;
}

/* Single-Row Relay Strips */
.relay-row-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
  min-height: 52px;
}

.relay-row-card:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  border-color: #cbd5e1;
}

.relay-row-card.state-on {
  border-left: 5px solid #16a34a;
  background: linear-gradient(90deg, #f0fdf4 0%, #ffffff 12%);
}

.relay-row-card.state-off {
  border-left: 5px solid #94a3b8;
  background: #ffffff;
}

.relay-row-card .status-pill-on,
.relay-row-card .status-pill-off {
  width: auto;
  min-width: 48px;
  padding: 4px 8px;
  font-size: 0.75rem;
}

.relay-row-card .btn-sm {
  padding: 3px 8px;
  font-size: 0.75rem;
}

.relay-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 76px;
}

.relay-status-pill.on {
  background-color: #16a34a !important;
  color: #ffffff !important;
  border: 1px solid #15803d;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.relay-status-pill.off {
  background-color: #e2e8f0 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Industrial Status Indicators matching ESP32 Controller Table */
.status-pill-on {
  background-color: #16a34a !important;
  color: #ffffff !important;
  font-weight: 700;
  width: 96px;
  min-width: 96px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 6px 0;
  border-radius: 5px;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  border: 1px solid #15803d;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  line-height: 1.2;
}

.status-pill-off {
  background-color: #e2e8f0 !important;
  color: #475569 !important;
  font-weight: 700;
  width: 96px;
  min-width: 96px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 6px 0;
  border-radius: 5px;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  line-height: 1.2;
}

.btn-relay-off {
  background-color: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
  font-weight: 600;
}

.btn-relay-off:hover:not(:disabled) {
  background-color: #cbd5e1 !important;
  border-color: #94a3b8 !important;
  color: #1e293b !important;
}

.btn-relay-on {
  background-color: #16a34a !important;
  border-color: #16a34a !important;
  color: #ffffff !important;
  font-weight: 600;
}

.btn-relay-on:hover:not(:disabled) {
  background-color: #15803d !important;
  border-color: #15803d !important;
  color: #ffffff !important;
}

.btn-relay-pulse {
  background-color: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 500;
}

.btn-relay-pulse:hover:not(:disabled) {
  background-color: #0369a1 !important;
  border-color: #0369a1 !important;
  color: #ffffff !important;
}

.btn-relay-pulsing {
  background-color: #f59e0b !important;
  border-color: #d97706 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}

.btn-relay-pulsing:hover {
  background-color: #d97706 !important;
  border-color: #b45309 !important;
  color: #ffffff !important;
}

.ro-toggle-btn {
  width: 96px;
  min-width: 96px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin: 0 2px;
  padding: 5px 0;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 5px;
  transition: all 0.15s ease-in-out;
}

.ro-pulse-btn {
  width: 108px;
  min-width: 108px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin: 0 2px;
  padding: 5px 0;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 5px;
  transition: all 0.15s ease-in-out;
}

.badge-auto-mode {
  background-color: #e0e7ff;
  color: #3730a3;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  border: 1px solid #c7d2fe;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.relay-status-indicator {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.relay-status-indicator.on {
  background-color: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}

.relay-status-indicator.off {
  background-color: #94a3b8;
}

/* Single-Row DI Strips */
.di-row-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
  min-height: 48px;
}

.di-row-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.di-row-card.ok {
  border-left: 4px solid #16a34a;
}

.di-row-card.triggered {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(90deg, #fefce8 0%, #ffffff 15%);
}

.di-icon-sm {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Incident & Alarm Styling */
.shield-ok-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 14px 20px;
  color: #166534;
}

.incident-alert-card {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 5px solid #ef4444;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.08);
}

.badge-critical {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 12px;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 12px;
}

.badge-recovered {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 12px;
}

.badge-info {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-weight: 600;
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 12px;
}

/* Dashboard Live Probes Matrix */
.cursor-pointer {
  cursor: pointer;
}

.dash-sensor-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.dash-sensor-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  border-color: #0284c7;
}

.dash-sensor-card.ok {
  border-left: 4px solid #16a34a;
}

.dash-sensor-card.alarm {
  border-left: 4px solid #ef4444;
  background: linear-gradient(135deg, #fef2f2 0%, #ffffff 45%);
}

.dash-sensor-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* Sensdesk Multi-Chart Styling */
.sensdesk-control-bar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.sensdesk-sensor-card {
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.sensdesk-sensor-card > .card-header:first-child {
  border-top-left-radius: 9px;
  border-top-right-radius: 9px;
}

.sensdesk-sensor-card > .card-footer:last-child {
  border-bottom-left-radius: 9px;
  border-bottom-right-radius: 9px;
}

.sensdesk-sensor-card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06) !important;
  border-color: #cbd5e1;
}

.sensdesk-sensor-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.sensdesk-stats-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.sensdesk-live-badge {
  font-weight: 700;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

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

.sensdesk-chart-wrapper canvas {
  cursor: crosshair;
}

@keyframes sensdesk-highlight-pulse {
  0% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.5); border-color: #0284c7; }
  50% { box-shadow: 0 0 0 6px rgba(2, 132, 199, 0.25); border-color: #0284c7; }
  100% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0); border-color: #e2e8f0; }
}

.sensdesk-card-highlight {
  animation: sensdesk-highlight-pulse 2s ease-in-out;
  border-color: #0284c7 !important;
}

/* Admin Panel & Utility Extensions */
.btn-xs {
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  line-height: 1.3;
  border-radius: 4px;
}

.font-monospace {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
}

.admin-subtab-content {
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Multi-Sensor Combined / My Graph Chips */
.sensor-chip {
  cursor: pointer;
  user-select: none;
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #475569;
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sensor-chip:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
}
.sensor-chip.active {
  background-color: #ffffff;
  border-color: #0284c7;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.15);
  font-weight: 600;
}
.sensor-chip .chip-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease;
}
.sensor-chip .chip-dot:hover {
  transform: scale(1.25);
}
.sensor-chip.inactive {
  opacity: 0.5;
  background-color: #f8fafc;
  border-color: #e2e8f0;
  text-decoration: line-through;
}
.sensor-chip .dropdown-toggle::after {
  display: none !important;
}
.sensor-chip-clickable {
  cursor: pointer;
  user-select: none;
}

/* SensDesk Graph Color Customization */
.sensdesk-color-swatch-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.2);
  vertical-align: middle;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.sensdesk-color-picker-menu {
  min-width: 220px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
}

.sensdesk-color-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.sensdesk-color-swatch-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sensdesk-color-swatch-btn:hover {
  transform: scale(1.25);
  box-shadow: 0 0 0 2px #0284c7;
  z-index: 2;
}

.sensdesk-color-swatch-btn.active {
  box-shadow: 0 0 0 2px #0f172a;
}

.sensdesk-native-color-input {
  width: 32px;
  height: 26px;
  cursor: pointer;
  border-radius: 4px;
}

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

.sensdesk-native-color-input::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.chip-color-hidden-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
  margin: 0;
}

/* =============================================================
   MODERN SAAS HERO SHOWCASE & CAPABILITIES STYLES
   ============================================================= */

/* Navbar "Try Demo" Glow Button */
.btn-demo-pulse {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.82rem;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.35);
  transition: all 0.2s ease-in-out;
}

.btn-demo-pulse:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  box-shadow: 0 0 18px rgba(14, 165, 233, 0.6);
  transform: translateY(-1px);
}

/* Global Interactive Demo Mode Alert */
.demo-mode-alert {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-color: rgba(56, 189, 248, 0.3) !important;
  border-left: 4px solid #38bdf8 !important;
  color: #e2e8f0;
}

.demo-badge-pulse {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 12px;
}

/* Hero Showcase Main Outer Container */
.hero-feature-wrapper {
  position: relative;
}

.hero-feature-container {
  position: relative;
  background: radial-gradient(circle at 15% 20%, rgba(14, 165, 233, 0.16) 0%, transparent 45%),
              radial-gradient(circle at 85% 80%, rgba(139, 92, 246, 0.14) 0%, transparent 40%),
              radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.06) 0%, transparent 50%),
              linear-gradient(135deg, #0b1329 0%, #0f172a 45%, #0d1b2a 100%);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 50px -12px rgba(2, 6, 23, 0.75), 0 0 35px 0 rgba(14, 165, 233, 0.12);
  color: #ffffff;
}

/* Top Toolbar inside Hero (Slide count & minimize button) */
.hero-top-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 36px 0 36px;
  font-size: 0.92rem;
  position: relative;
  z-index: 5;
}

.hero-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  border-radius: 20px;
  padding: 5px 15px;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.hero-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

/* Collapsed Features Strip */
.hero-collapsed-bar {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  border-left: 4px solid #0284c7;
}

/* Slide Content Formatting */
.hero-slide-pane {
  padding: 28px 40px 36px 40px;
  min-height: 410px;
  max-width: 1380px;
  margin: 0 auto;
}

#heroFeatureCarousel .carousel-inner {
  overflow: hidden;
  position: relative;
  width: 100%;
}

#heroFeatureCarousel .carousel-item {
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

.hero-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
  color: #e2e8f0;
}

.hero-slide-title {
  font-size: 2.45rem;
  font-weight: 800;
  line-height: 1.22;
  color: #ffffff;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.gradient-text-cyan {
  background: linear-gradient(135deg, #38bdf8 0%, #22d3ee 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-purple {
  background: linear-gradient(135deg, #c084fc 0%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-amber {
  background: linear-gradient(135deg, #fcd34d 0%, #f97316 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-rose {
  background: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-emerald {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-slide-desc {
  font-size: 1.12rem;
  color: #cbd5e1;
  line-height: 1.62;
  margin-bottom: 24px;
  max-width: 660px;
}

/* Feature Chips Row */
.hero-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  padding: 7px 14px;
  font-size: 0.88rem;
  color: #e2e8f0;
  font-weight: 500;
  backdrop-filter: blur(8px);
}

/* Action Buttons */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.btn-hero-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #ffffff;
  font-weight: 700;
  font-size: 1.02rem;
  padding: 12px 26px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.btn-hero-primary:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.6);
}

.btn-hero-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
  font-weight: 600;
  font-size: 1.02rem;
  padding: 12px 24px;
  border-radius: 12px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Right-Hand Micro-Dashboard Mockups */
.hero-mockup-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 10px;
}

@media (min-width: 992px) {
  .hero-mockup-wrapper {
    justify-content: flex-start;
    padding-left: 12px;
  }
}

.hero-mockup-card {
  width: 100%;
  max-width: 530px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55), 0 0 24px rgba(14, 165, 233, 0.15);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.hero-mockup-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.45);
}

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

.mockup-node-name {
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.6px;
}

.mockup-metric-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
}

.mockup-metric-val {
  font-size: 2.25rem;
  font-weight: 700;
  display: block;
  line-height: 1.15;
  margin-top: 4px;
  letter-spacing: -0.5px;
}

/* SVG Chart Mockup Extras */
.mockup-chart-tooltip {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.84rem;
  color: #cbd5e1;
  font-family: monospace;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

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

.text-purple {
  color: #c084fc !important;
}

.text-cyan {
  color: #22d3ee !important;
}

.text-emerald {
  color: #10b981 !important;
}

/* LCD Digits in Metering Mockup */
.mockup-lcd-meter {
  background: #030712 !important;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.9);
}

.lcd-num {
  display: inline-block;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 1.95rem;
  margin: 0 2px;
}

.pulse-amber {
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  animation: pulse-amber-anim 1.6s infinite;
}

@keyframes pulse-amber-anim {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Relay LED Lights */
.mockup-relay-led {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.led-green {
  background-color: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}

.led-gray {
  background-color: #475569;
}

/* Bottom Carousel Controls & Indicators */
.hero-bottom-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 36px 18px 36px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-nav-arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 1rem;
}

.hero-nav-arrow:hover {
  background: rgba(14, 165, 233, 0.3);
  border-color: rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  transform: scale(1.08);
}

.hero-indicators-strip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-indicator-bar {
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  border: none;
  padding: 0;
  transition: all 0.25s ease;
}

.hero-indicator-bar.active {
  width: 64px;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

/* =============================================================
   MEASURED QUANTITIES & CAPABILITIES SHOWCASE BAR
   ============================================================= */
.sensor-capabilities-bar {
  background: linear-gradient(135deg, #0b1329 0%, #0f172a 100%);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  overflow: hidden;
}

.capabilities-inner {
  background: rgba(15, 23, 42, 0.45);
}

.cap-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.cap-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 8px 16px;
  font-size: 0.88rem;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.cap-pill:hover {
  background: rgba(14, 165, 233, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.25);
}

.cap-pill-name {
  font-weight: 600;
}

.cap-pill-spec {
  color: #94a3b8;
  font-size: 0.82rem;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  padding-left: 8px;
}

/* Responsive Overrides */
@media (max-width: 991.98px) {
  .hero-slide-pane {
    padding: 20px 20px 28px 20px;
    min-height: auto;
  }
  .hero-slide-title {
    font-size: 1.85rem;
  }
  .hero-slide-desc {
    font-size: 1rem;
  }
  .hero-mockup-card {
    max-width: 100%;
    margin-top: 20px;
    padding: 18px;
  }
  .mockup-metric-val {
    font-size: 1.85rem;
  }
  .lcd-num {
    font-size: 1.5rem;
    padding: 3px 6px;
  }
  .hero-top-toolbar {
    padding: 12px 20px 0 20px;
  }
  .hero-bottom-controls {
    padding: 10px 20px 16px 20px;
  }
}

/* =============================================================
   INSTALLABLE PWA & MOBILE CONTROL MODE STYLES
   ============================================================= */

.mobile-workspace-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #ffffff;
}

.mobile-header-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.mobile-gw-select {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.78rem;
  border-radius: 8px;
  min-width: 145px;
}

.mobile-gw-select option {
  background-color: #0f172a;
  color: #ffffff;
}

.mob-kpi-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 7px 6px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.mob-kpi-pill:active,
.mob-kpi-pill:hover {
  background: rgba(14, 165, 233, 0.18);
  border-color: rgba(56, 189, 248, 0.4);
}

.mob-kpi-val {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.15;
}

.mob-kpi-lbl {
  display: block;
  font-size: 0.68rem;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

/* Mobile Filter Chips */
.mob-filter-pills {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.mob-filter-pills::-webkit-scrollbar {
  display: none;
}

.mob-filter-chip {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.mob-filter-chip:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.mob-filter-chip.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.mob-tool-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
}

.mob-tool-btn.active {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  color: #34d399;
}

/* Mobile Sensor, DI & Relay Live Tiles */
.navbar.sticky-top {
  padding-top: max(0.5rem, env(safe-area-inset-top, 0px));
}

.mob-tile-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.04);
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
  height: 100%;
  user-select: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mob-tile-card:active {
  transform: scale(0.985);
}

.mob-tile-card.tile-ok {
  border-left: 5px solid #16a34a;
}

.mob-tile-card.tile-alarm {
  border-left: 5px solid #dc2626;
  border-color: #fca5a5;
  background: linear-gradient(135deg, #fef2f2 0%, #ffffff 55%);
  animation: mob-alarm-pulse 2s infinite;
}

.mob-tile-card.tile-nodata {
  border-left: 5px solid #94a3b8;
  background: #f8fafc;
}

@keyframes mob-alarm-pulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.32); }
  70% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.mob-tile-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mob-tile-val,
.mob-tile-value {
  font-size: 1.38rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.4px;
  line-height: 1.15;
}

.mob-tile-unit {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  margin-left: 2px;
}

.mob-tile-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
  min-width: 0;
  overflow: hidden;
}

.mob-tile-gw {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 500;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mob-fav-star,
.mob-fav-btn {
  background: transparent;
  border: none;
  padding: 2px 4px;
  color: #cbd5e1;
  font-size: 0.95rem;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s ease, transform 0.15s ease;
}

.mob-fav-star:hover,
.mob-fav-star.pinned,
.mob-fav-btn:hover,
.mob-fav-btn.active {
  color: #f59e0b;
  transform: scale(1.1);
}

/* Mobile Touch Relay Card */
.mob-relay-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.04);
  transition: all 0.15s ease;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mob-relay-card .status-pill-on,
.mob-relay-card .status-pill-off {
  min-width: auto !important;
  padding: 3px 10px !important;
  font-size: 0.72rem !important;
  border-radius: 6px;
}

.mob-relay-card.state-on {
  border-left: 5px solid #16a34a;
  background: linear-gradient(90deg, #f0fdf4 0%, #ffffff 25%);
}

.mob-relay-card.state-off {
  border-left: 5px solid #94a3b8;
  background: #ffffff;
}

.mob-relay-actions,
.mob-relay-btn-group {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.mob-relay-actions .ro-toggle-btn,
.mob-relay-btn-group .ro-toggle-btn {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  padding: 8px 12px !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  margin: 0 !important;
}

.mob-relay-actions .ro-pulse-btn,
.mob-relay-btn-group .ro-pulse-btn {
  flex: 0 0 110px !important;
  width: 110px !important;
  min-width: 110px !important;
  padding: 8px 12px !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  margin: 0 !important;
}

/* Fixed Bottom Navigation Bar for Mobile & Standalone App */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(56, 189, 248, 0.22);
  z-index: 1045;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 18px rgba(2, 6, 23, 0.35);
}

.mob-nav-btn {
  flex: 1;
  height: 100%;
  background: transparent;
  border: none;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 6px 2px;
  transition: color 0.15s ease;
  position: relative;
}

.mob-nav-btn i {
  font-size: 1.15rem;
}

.mob-nav-btn.active {
  color: #38bdf8;
}

.mob-nav-btn.active::after {
  content: "";
  position: absolute;
  top: 0;
  width: 32px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: #38bdf8;
}

.mob-nav-badge {
  position: absolute;
  top: 5px;
  right: calc(50% - 20px);
  background: #ef4444;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #0f172a;
}

/* Show Bottom Nav on Mobile Screens or when Mobile Mode is active */
body.mobile-mode-active .mobile-bottom-nav {
  display: flex;
}

body.mobile-mode-active {
  padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 991.98px) {
  .mobile-bottom-nav {
    display: flex;
  }
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }
}

/* Responsive Stacked Card Tables on Mobile Screens (No Horizontal Slider) */
@media (max-width: 767.98px) {
  .table-responsive:has(.mobile-stack-table) {
    overflow-x: visible !important;
  }

  .mobile-stack-table,
  .mobile-stack-table tbody {
    display: block;
    width: 100%;
  }

  .mobile-stack-table thead {
    display: none;
  }

  .mobile-stack-table tbody tr {
    display: block;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin: 10px 12px;
    padding: 8px 12px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  }

  .mobile-stack-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 2px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    text-align: right !important;
    font-size: 0.85rem;
    min-width: 0;
  }

  .mobile-stack-table tbody td:last-child {
    border-bottom: none !important;
  }

  .mobile-stack-table tbody td[data-label]::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.3px;
    text-align: left;
    flex-shrink: 0;
  }

  .mobile-stack-table tbody td.mob-table-actions-cell {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding-top: 10px !important;
  }

  .mobile-stack-table tbody td.mob-table-actions-cell::before {
    margin-bottom: 2px;
  }

  .mobile-stack-table tbody td.mob-table-actions-cell > div {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px !important;
  }

  .mobile-stack-table tbody td.mob-table-actions-cell .btn {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
    display: inline-flex;
    align-items: center;
  }

  /* Compact container & Sensdesk Chart Card Header on Mobile */
  .container-fluid.px-4 {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .sensdesk-sensor-card > .card-header {
    padding: 0.65rem 0.75rem !important;
    gap: 0.5rem !important;
  }

  .sensdesk-header-right {
    width: 100%;
    margin-left: 0 !important;
  }

  .sensdesk-card-actions {
    width: 100%;
    gap: 6px !important;
    justify-content: flex-start;
  }

  .sensdesk-live-badge {
    font-size: 0.88rem !important;
    padding: 0.22rem 0.5rem !important;
  }

  /* Compact Alarm Level Filter Buttons on Mobile */
  #alarm-level-filters .btn {
    padding: 0.25rem 0.3rem !important;
    font-size: 0.74rem !important;
    white-space: nowrap;
  }

  .mobile-stack-table tbody td.mob-alarm-desc-cell {
    flex-direction: column;
    align-items: flex-start;
    text-align: left !important;
    gap: 4px;
    overflow-wrap: anywhere;
  }
}



