/* =====================================================================
   CISCO ROOM NAVIGATOR 10" TOUCH PANEL - TUYA SMART ROOM CONTROLLER
   Theme: Cisco RoomOS Dark Glassmorphism
   Target Display: 10.1" (1280x800 to 1920x1200 capacitive touchscreen)
   ===================================================================== */

:root {
  /* Color Palette - RoomOS Inspired */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-surface: rgba(19, 27, 43, 0.72);
  --bg-surface-hover: rgba(27, 38, 60, 0.85);
  --bg-card: rgba(16, 24, 40, 0.88);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 188, 235, 0.5);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Brand Accents */
  --cisco-blue: #00bceb;
  --cisco-blue-glow: rgba(0, 188, 235, 0.35);
  --cisco-blue-deep: #0070d2;
  
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.35);
  
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.4);
  
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.35);
  
  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.35);

  /* Radius & Shadows */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 9999px;
  
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.06);
  --shadow-active: 0 0 20px var(--cisco-blue-glow);
  
  /* Touch Ergonomics */
  --touch-min-height: 48px;
  --header-height: 68px;
}

/* Global Reset & Touch Optimization */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-primary);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

body {
  background: radial-gradient(circle at 15% 15%, rgba(0, 188, 235, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.05) 0%, transparent 45%),
              linear-gradient(180deg, #090d16 0%, #0d1321 100%);
  display: flex;
  flex-direction: column;
}

/* Main Container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  max-width: 100%;
  padding: 12px 18px;
  gap: 12px;
}

/* Custom Scrollbar for touch-overflow elements */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* =====================================================================
   HEADER BAR
   ===================================================================== */
.app-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0 18px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-shrink: 0;
}

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

.room-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.room-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(0, 188, 235, 0.18), rgba(0, 112, 210, 0.28));
  border: 1px solid rgba(0, 188, 235, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cisco-blue);
  flex-shrink: 0;
}

.room-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
  white-space: nowrap;
}

.room-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 1px;
}

.ambient-badge {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.ambient-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ambient-icon {
  font-size: 0.9rem;
}

.ambient-divider {
  width: 1px;
  height: 12px;
  background: var(--border-subtle);
}

/* Room Scenes Presets (Column 3 - Room Actions) */
.room-scenes-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
}

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

.scenes-active-label {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  font-weight: 600;
  background: rgba(0, 188, 235, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 188, 235, 0.25);
}

.scenes-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.scene-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 48px;
  text-align: center;
}

.scene-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.scene-btn:active {
  transform: scale(0.96);
}

.scene-btn.active {
  background: linear-gradient(135deg, rgba(0, 188, 235, 0.25), rgba(0, 112, 210, 0.35));
  border-color: var(--cisco-blue);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(0, 188, 235, 0.25);
}

.scene-btn.scene-off.active {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--accent-red);
  color: #ff8888;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

.scene-btn .scene-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.scene-btn .scene-label {
  line-height: 1.1;
  white-space: nowrap;
}

/* Header Right */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clock-display {
  text-align: right;
  display: flex;
  flex-direction: column;
}

.clock-time {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.clock-date {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.status-dot.pulsing {
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.ops-wizard-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(0, 188, 235, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid var(--cisco-blue);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.ops-wizard-btn:active {
  transform: scale(0.94);
  background: var(--cisco-blue);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* =====================================================================
   MAIN WORKSPACE GRID
   ===================================================================== */
.main-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1.15fr 0.95fr;
  gap: 14px;
  min-height: 0;
  transition: grid-template-columns 0.3s ease;
}

/* Adaptive 2-column layout when room has no climate units */
.main-grid.no-climate {
  grid-template-columns: 1.25fr 1fr;
}

.control-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.card-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.015);
  flex-shrink: 0;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
}

.card-icon.light-glow {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 0 16px var(--accent-amber-glow);
}

.card-icon.ac-glow {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: 0 0 16px var(--accent-cyan-glow);
}

.card-icon.room-glow {
  background: rgba(0, 188, 235, 0.15);
  border-color: rgba(0, 188, 235, 0.3);
}

.card-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #ffffff;
}

.card-caption {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
  display: block;
  margin-top: 1px;
}

.toggle-master-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-master-btn:active {
  transform: scale(0.92);
}

.toggle-master-btn.active {
  background: linear-gradient(135deg, var(--cisco-blue), var(--cisco-blue-deep));
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 0 16px var(--cisco-blue-glow);
}

.card-body {
  padding: 16px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

/* =====================================================================
   DEVICE TILES: SWITCHES & DIMMERS
   ===================================================================== */
.device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 58px;
  cursor: pointer;
}

.device-row:active {
  transform: scale(0.985);
}

.device-row.active {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.12);
}

.device-row.no-border {
  border: none;
  background: transparent;
  padding: 0 0 10px 0;
  min-height: auto;
  box-shadow: none;
  cursor: default;
}

.device-row.no-border:active {
  transform: none;
}

.device-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.device-icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.2rem;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.device-icon-box.active {
  background: rgba(245, 158, 11, 0.22);
  border-color: var(--accent-amber);
  color: #fbbf24;
  box-shadow: 0 0 16px var(--accent-amber-glow);
}

.device-name {
  font-size: 0.94rem;
  font-weight: 600;
  color: #ffffff;
  display: block;
}

.device-status {
  font-size: 0.74rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 1px;
}

/* Custom Touch Toggle Switch */
.touch-toggle-switch {
  width: 58px;
  height: 34px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--border-subtle);
  position: relative;
  cursor: pointer;
  padding: 3px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.touch-toggle-switch .switch-handle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  display: block;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.touch-toggle-switch.active {
  background: var(--accent-amber);
  border-color: #f59e0b;
  box-shadow: 0 0 16px var(--accent-amber-glow);
}

.touch-toggle-switch.active .switch-handle {
  transform: translateX(24px);
}

/* Dimmer Card */
.dimmer-zone-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dimmer-zone-box.active {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.1);
}

.dimmer-controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dimmer-value-tag {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-amber);
  padding: 4px 12px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  min-width: 54px;
  text-align: center;
}

.slider-wrapper {
  position: relative;
  height: 44px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.slider-track-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.35) 0%, rgba(245, 158, 11, 0.85) 100%);
  pointer-events: none;
  transition: width 0.05s ease-out;
}

.touch-slider {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  outline: none;
}

.touch-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 44px;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
  cursor: grab;
  border: 2px solid var(--accent-amber);
}

.touch-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.05);
}

.dimmer-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.preset-chip {
  min-height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:active {
  transform: scale(0.95);
}

.preset-chip.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--accent-amber);
  color: #ffffff;
  box-shadow: 0 0 10px var(--accent-amber-glow);
}

/* =====================================================================
   CARD 2: CLIMATE & IR AC CONTROLS
   ===================================================================== */
.climate-body {
  justify-content: space-between;
}

.ac-unit-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.thermostat-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 4px 0;
}

.temp-stepper-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.temp-stepper-btn:active {
  transform: scale(0.9);
  background: rgba(0, 188, 235, 0.25);
  border-color: var(--cisco-blue);
}

.stepper-symbol {
  font-size: 1.8rem;
  font-weight: 300;
  line-height: 1;
}

.thermostat-display {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 24, 40, 0.95) 50%, rgba(6, 182, 212, 0.15) 100%);
  border: 3px solid rgba(6, 182, 212, 0.4);
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.25), inset 0 0 20px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: default;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.thermostat-display.heating {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.25), inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.thermostat-display.power-off {
  border-color: var(--border-subtle);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
  opacity: 0.55;
  background: radial-gradient(circle, rgba(16, 24, 40, 0.85) 50%, rgba(255, 255, 255, 0.03) 100%);
}

.thermostat-state-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
  margin-top: 4px;
}

.thermostat-display.power-off .thermostat-state-badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.thermostat-power-row {
  display: flex;
  justify-content: center;
  margin: 4px 0 2px 0;
}

.ac-card-power-btn {
  height: 42px;
  width: 100%;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ac-card-power-btn:active {
  transform: scale(0.98);
}

.ac-card-power-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(0, 188, 235, 0.25));
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 16px var(--accent-cyan-glow);
}

.ac-card-power-btn.busy,
#btnAcPowerToggle.busy {
  pointer-events: none !important;
  opacity: 0.65 !important;
  cursor: wait !important;
}

.temp-readout {
  display: flex;
  align-items: baseline;
  justify-content: center;
}

.target-degrees {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #ffffff;
  line-height: 1;
}

.degree-symbol {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-left: 2px;
}

.temp-ambient-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.temp-ambient-sub strong {
  color: #38bdf8;
  font-weight: 600;
}

.climate-modes {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.mode-chip {
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-chip:active {
  transform: scale(0.94);
}

.mode-icon {
  font-size: 1.1rem;
}

.mode-text {
  font-size: 0.7rem;
  font-weight: 600;
}

.mode-chip.active {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 12px var(--accent-cyan-glow);
}

.climate-extra-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.sub-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 5px;
}

.fan-chips {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
}

.fan-chip {
  min-height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fan-chip:active {
  transform: scale(0.95);
}

.fan-chip.active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.extra-toggles {
  display: flex;
  gap: 6px;
}

.pill-toggle-btn {
  min-height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-toggle-btn:active {
  transform: scale(0.95);
}

.pill-toggle-btn.active {
  background: rgba(0, 188, 235, 0.2);
  border-color: var(--cisco-blue);
  color: #ffffff;
  box-shadow: 0 0 10px var(--cisco-blue-glow);
}

/* =====================================================================
   CARD 3: AUXILIARY & SHORTCUTS (Plugs, Curtains)
   ===================================================================== */
.overview-body {
  justify-content: space-between;
}

.dynamic-aux-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aux-device-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.aux-device-card:active {
  transform: scale(0.985);
}

.aux-device-card.active {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.12);
}

.empty-state-box {
  padding: 32px 20px;
  text-align: center;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.015);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: auto 0;
}

.empty-state-icon {
  font-size: 2.2rem;
  margin-bottom: 2px;
}

.empty-state-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #ffffff;
}

.empty-state-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  max-width: 280px;
  line-height: 1.4;
  margin-bottom: 6px;
}

.quick-add-climate-pill {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(0, 188, 235, 0.15));
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #38bdf8;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.quick-add-climate-pill:active {
  transform: scale(0.98);
  background: rgba(6, 182, 212, 0.25);
  color: #ffffff;
}

.curtain-controls {
  display: flex;
  gap: 5px;
}

.curtain-btn {
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.curtain-btn:active {
  background: var(--cisco-blue);
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.telemetry-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  text-align: center;
}

.telemetry-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
}

.telemetry-value {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 3px 0 1px 0;
}

.telemetry-sub {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.text-teal { color: #2dd4bf; }
.text-amber { color: #f59e0b; }
.text-blue { color: #38bdf8; }

.quick-actions-box {
  margin: 6px 0;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.action-tile {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 58px;
}

.action-tile:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.08);
}

.action-icon {
  font-size: 1.15rem;
  display: block;
  margin-bottom: 3px;
}

.action-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
  display: block;
}

.action-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: block;
  margin-top: 1px;
}

.action-tile.tile-danger {
  border-color: rgba(239, 68, 68, 0.3);
}

.action-tile.tile-danger:active {
  background: rgba(239, 68, 68, 0.2);
}

.navigator-info-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0, 188, 235, 0.08);
  border: 1px solid rgba(0, 188, 235, 0.2);
  border-radius: var(--radius-md);
}

.nav-tag {
  font-size: 0.68rem;
  color: var(--cisco-blue);
  font-weight: 600;
  text-transform: uppercase;
  display: block;
}

.nav-ip {
  font-size: 0.8rem;
  font-family: monospace;
  color: #ffffff;
  display: block;
  margin-top: 1px;
}

.nav-guide-btn {
  padding: 5px 10px;
  background: rgba(0, 188, 235, 0.2);
  border: 1px solid var(--cisco-blue);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-guide-btn:active {
  transform: scale(0.95);
  background: var(--cisco-blue);
}

/* =====================================================================
   OPERATIONS SETUP WIZARD & DYNAMIC DEVICE LIST
   ===================================================================== */
.wizard-backdrop {
  z-index: 150;
  background: rgba(4, 7, 14, 0.88);
  backdrop-filter: blur(14px);
}

.wizard-dialog {
  max-width: 820px;
  width: 95%;
  max-height: 92vh;
  border: 1px solid rgba(0, 188, 235, 0.3);
  box-shadow: 0 0 40px rgba(0, 188, 235, 0.18), 0 25px 60px rgba(0, 0, 0, 0.9);
}

.wizard-header {
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 188, 235, 0.04);
}

.wizard-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wizard-icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(0, 188, 235, 0.15);
  border: 1px solid var(--cisco-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.wizard-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.wizard-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* Stepper Bar */
.wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-subtle);
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.step-indicator.active {
  color: #ffffff;
}

.step-indicator.completed {
  color: var(--accent-green);
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
}

.step-indicator.active .step-num {
  background: var(--cisco-blue);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 0 12px var(--cisco-blue-glow);
}

.step-indicator.completed .step-num {
  background: var(--accent-green);
  color: #ffffff;
}

.step-line {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 14px;
}

.wizard-content {
  padding: 20px 22px;
  overflow-y: auto;
  max-height: calc(92vh - 190px);
}

.step-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.step-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Mode Selection Cards */
.mode-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.mode-select-card {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.mode-select-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.mode-select-card.selected {
  background: rgba(0, 188, 235, 0.08);
  border-color: var(--cisco-blue);
  box-shadow: 0 0 20px rgba(0, 188, 235, 0.25);
}

.mode-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 7px;
  border-radius: var(--radius-full);
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 10px;
}

.badge-green { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-blue { background: rgba(0, 188, 235, 0.15); color: #38bdf8; border: 1px solid rgba(0, 188, 235, 0.3); }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

.mode-card-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.mode-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 5px;
}

.mode-card-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.4;
  flex: 1;
  margin-bottom: 10px;
}

.mode-card-features {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-primary);
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}

/* Local Discovery Banner */
.scan-banner {
  background: rgba(0, 188, 235, 0.08);
  border: 1px solid rgba(0, 188, 235, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.scan-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
}

.scan-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

.scan-btn {
  display: flex;
  align-items: center;
  gap: 6px;
}

.scan-results-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
}

.discovered-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.device-tag-chip {
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-family: monospace;
  color: #38bdf8;
  cursor: pointer;
  transition: all 0.15s ease;
}

.device-tag-chip:hover {
  background: rgba(0, 188, 235, 0.2);
  border-color: var(--cisco-blue);
  color: #ffffff;
}

/* Devices Toolbar in Wizard */
.devices-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 10px 0;
}

.toolbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.toolbar-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.add-device-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(0, 188, 235, 0.2), rgba(0, 112, 210, 0.3));
  border: 1px solid var(--cisco-blue);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.add-device-btn:active {
  transform: scale(0.96);
  background: var(--cisco-blue);
}

.dynamic-device-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Wizard Dynamic Device Card */
.wiz-device-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease;
}

.wiz-device-card:hover {
  border-color: rgba(0, 188, 235, 0.35);
}

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

.wiz-dev-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

.wiz-dev-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.btn-remove-dev {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  color: #ef4444;
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-remove-dev:active {
  background: #ef4444;
  color: #ffffff;
}

.wiz-dev-fields-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.2fr;
  gap: 10px;
}

.wiz-dev-creds-row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr;
  gap: 10px;
}

.test-inline-btn {
  height: 42px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.test-inline-btn:active {
  background: var(--cisco-blue);
  transform: scale(0.96);
}

/* Wizard Summary & Finish */
.completion-box {
  text-align: center;
  padding: 8px 16px;
}

.completion-icon {
  font-size: 2.8rem;
  margin-bottom: 8px;
}

.completion-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
}

.completion-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 4px 0 16px 0;
}

.summary-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.summary-label {
  color: var(--text-muted);
}

.cisco-reminder-box {
  background: rgba(0, 188, 235, 0.08);
  border: 1px solid rgba(0, 188, 235, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  text-align: left;
}

.cisco-reminder-box h4 {
  font-size: 0.88rem;
  color: var(--cisco-blue);
  margin-bottom: 3px;
}

.cisco-reminder-box p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4) !important;
}

.wizard-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
}

.relaunch-wizard-box {
  background: rgba(0, 188, 235, 0.08);
  border: 1px solid rgba(0, 188, 235, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.relaunch-wizard-box h4 {
  font-size: 0.92rem;
  color: #ffffff;
}

.relaunch-wizard-box p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* =====================================================================
   STANDARD MODAL & FORMS
   ===================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-dialog {
  width: 100%;
  max-width: 650px;
  background: #111827;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 90vh;
}

.modal-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-icon {
  font-size: 1.4rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

.modal-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.config-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.tab-btn {
  padding: 7px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-subtle);
  color: #ffffff;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-row {
  display: flex;
  gap: 10px;
}

.col-6 {
  flex: 1;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  height: 42px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 12px;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  border-color: var(--cisco-blue);
  box-shadow: 0 0 10px var(--cisco-blue-glow);
}

.form-help {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.form-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cisco-blue);
  margin-top: 8px;
}

.test-connection-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

.test-result-msg {
  font-size: 0.82rem;
  font-weight: 500;
}

.test-result-msg.success { color: var(--accent-green); }
.test-result-msg.error { color: var(--accent-red); }

.cisco-instruction-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.cisco-instruction-box h4 {
  font-size: 0.92rem;
  color: #ffffff;
  margin-bottom: 6px;
}

.cisco-instruction-box p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.cisco-instruction-box ol {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.cisco-instruction-box code {
  background: rgba(0, 188, 235, 0.15);
  color: #38bdf8;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(255, 255, 255, 0.015);
}

.primary-btn {
  height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--cisco-blue), var(--cisco-blue-deep));
  border: none;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 14px var(--cisco-blue-glow);
}

.primary-btn:active {
  transform: scale(0.97);
}

.secondary-btn {
  height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-btn:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(16, 24, 40, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 10px 22px;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* =====================================================================
   RESPONSIVE DESIGN SYSTEM
   ===================================================================== */

/* 1. Large Monitors & Executive Wall Panels (> 1400px) */
@media (min-width: 1400px) {
  .app-container {
    max-width: 1680px;
    margin: 0 auto;
  }
}

/* 2. Compact Touchscreens & Landscape Tablets (1024px to 1250px) */
/* Optimized for Cisco Room Navigator 10" (1280x800, 1920x1200 high-DPI) */
@media (max-width: 1250px) {
  :root {
    --header-height: 60px;
  }
  .app-container {
    padding: 10px 14px;
    gap: 10px;
  }
  .app-header {
    padding: 0 16px;
    gap: 12px;
  }
  .header-left {
    gap: 12px;
  }
  .room-icon {
    width: 38px;
    height: 38px;
  }
  .room-title {
    font-size: 1.05rem;
  }
  .room-subtitle {
    font-size: 0.72rem;
  }
  .ambient-badge {
    padding: 4px 10px;
    font-size: 0.78rem;
    gap: 6px;
  }
  .header-right {
    gap: 10px;
  }
  .clock-time {
    font-size: 1.05rem;
  }
  .clock-date {
    font-size: 0.7rem;
  }
  .ops-wizard-btn {
    height: 36px;
    padding: 0 12px;
    font-size: 0.78rem;
  }
  .icon-btn {
    width: 38px;
    height: 38px;
  }
  .main-grid {
    gap: 10px;
  }
  .thermostat-display {
    width: 130px;
    height: 130px;
  }
}

/* 3. Mid-range Tablets & Split Viewports (769px to 1023px) */
@media (max-width: 1023px) {
  html, body {
    overflow-y: auto;
    height: auto;
    min-height: 100%;
  }
  .app-container {
    height: auto;
    min-height: 100vh;
    overflow-y: visible;
    padding: 12px 14px 24px 14px;
  }
  .app-header {
    height: auto;
    min-height: 58px;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }
  .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }
  .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  .main-grid {
    grid-template-columns: 1fr 1fr;
    flex: none;
    min-height: auto;
  }
  .main-grid.no-climate {
    grid-template-columns: 1fr 1fr;
  }
  .card-overview {
    grid-column: 1 / -1;
  }
  .action-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 4. Mobile Devices & Narrow Columns (<= 768px) */
@media (max-width: 768px) {
  :root {
    --radius-xl: 18px;
    --radius-lg: 14px;
  }
  html, body {
    overflow-y: auto;
    height: auto;
    min-height: 100%;
  }
  .app-container {
    height: auto;
    min-height: 100vh;
    padding: 10px 10px 36px 10px;
    gap: 10px;
    overflow-y: visible;
  }
  .app-header {
    height: auto;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-radius: var(--radius-lg);
  }
  .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }
  .room-icon {
    width: 34px;
    height: 34px;
  }
  .room-title {
    font-size: 0.96rem;
  }
  .room-subtitle {
    font-size: 0.7rem;
  }
  .ambient-badge {
    padding: 4px 8px;
    font-size: 0.74rem;
    gap: 6px;
  }
  .header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }
  .clock-time {
    font-size: 0.95rem;
  }
  .clock-date {
    display: none;
  }
  .status-indicator {
    padding: 6px 8px;
  }
  .status-indicator .status-text {
    display: none;
  }
  .ops-wizard-btn {
    height: 34px;
    padding: 0 10px;
    font-size: 0.75rem;
  }
  .ops-wizard-btn .ops-btn-text {
    display: none;
  }
  .icon-btn {
    width: 34px;
    height: 34px;
  }
  .main-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
    flex: none;
  }
  .card-overview {
    grid-column: 1 !important;
  }
  .control-card {
    border-radius: var(--radius-lg);
  }
  .card-body {
    padding: 14px;
    max-height: none;
    overflow: visible;
  }
  .action-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .telemetry-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .climate-modes {
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
  }
  .mode-chip {
    min-height: 44px;
    padding: 4px 2px;
  }
  .mode-icon {
    font-size: 0.95rem;
  }
  .mode-text {
    font-size: 0.62rem;
  }
  .thermostat-display {
    width: 135px;
    height: 135px;
  }

  /* Modals on Mobile */
  .modal-backdrop {
    padding: 8px;
    align-items: flex-end;
  }
  .modal-dialog {
    max-height: 94vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
  }
  .mode-cards-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .wiz-dev-fields-row,
  .wiz-dev-creds-row {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }
  .summary-card {
    grid-template-columns: 1fr !important;
  }
  .wizard-footer,
  .modal-footer {
    padding: 12px 14px;
  }
}

/* 4b. Ultra-compact Mobile (<= 540px) */
@media (max-width: 540px) {
  .app-header {
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 8px;
  }
  .header-left {
    width: 100%;
    justify-content: space-between;
  }
  .header-right {
    width: 100%;
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px solid var(--border-subtle);
  }
  .room-scenes-box .scenes-bar {
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    padding: 2px;
  }
  .room-scenes-box .scene-btn {
    padding: 6px 2px;
    font-size: 0.65rem;
    min-height: 42px;
  }
  .room-scenes-box .scene-btn .scene-icon {
    font-size: 0.95rem;
  }
}

/* 5. Height-Constrained Landscape Displays (height <= 720px and width > 768px) */
/* Crucial for 10" touch panels and landscape viewports with browser chrome/status bar */
@media (max-height: 720px) and (min-width: 769px) {
  :root {
    --header-height: 52px;
  }
  .app-container {
    padding: 8px 12px;
    gap: 8px;
  }
  .app-header {
    padding: 0 12px;
  }
  .room-icon {
    width: 32px;
    height: 32px;
  }
  .room-title {
    font-size: 0.92rem;
  }
  .room-subtitle {
    display: none;
  }
  .ambient-badge {
    padding: 3px 7px;
    font-size: 0.74rem;
  }
  .scene-btn {
    padding: 4px 8px;
    min-height: 30px;
    font-size: 0.74rem;
    gap: 4px;
  }
  .card-header {
    padding: 8px 14px;
  }
  .card-title {
    font-size: 0.92rem;
  }
  .card-caption {
    font-size: 0.7rem;
  }
  .card-body {
    padding: 10px 12px;
    gap: 8px;
  }
  .thermostat-display {
    width: 105px;
    height: 105px;
  }
  .thermostat-display .target-degrees {
    font-size: 2.1rem;
  }
  .thermostat-controls {
    gap: 10px;
  }
  .temp-btn {
    width: 38px;
    height: 38px;
    font-size: 1.25rem;
  }
  .mode-chip {
    min-height: 38px;
  }
  .device-row {
    min-height: 48px;
    padding: 8px 12px;
  }
  .dimmer-zone-box {
    padding: 10px 12px;
    gap: 8px;
  }
  .action-tile {
    min-height: 48px;
    padding: 6px 10px;
  }
  .telemetry-card {
    padding: 6px 8px;
  }
}

/* =====================================================================
   CISCO ROOM NAVIGATOR AUTHENTICATION MODAL OVERLAY
   ===================================================================== */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(7, 11, 20, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(145deg, rgba(22, 30, 49, 0.95), rgba(13, 19, 33, 0.98));
  border: 1px solid rgba(0, 188, 212, 0.25);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 188, 212, 0.12);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  position: relative;
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-badge-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: var(--radius-lg);
  background: rgba(0, 188, 212, 0.12);
  border: 1px solid rgba(0, 188, 212, 0.35);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.login-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.82rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
