
:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --color-brand-primary: #15803d;
  --color-brand-hover: #166534;
  --color-brand-dark: #0f392b;
  --color-brand-light: #ecfdf5;
  --color-brand-border: #bbf7d0;

  --color-sidebar-bg: #0b231a;
  --color-sidebar-hover: #123326;
  --color-sidebar-active: #174232;
  --color-sidebar-text: #d1fae5;
  --color-sidebar-muted: #6ee7b7;

  --color-bg-app: #f4f6f4;
  --color-bg-card: #ffffff;
  --color-bg-secondary: #f9fafb;

  --color-text-primary: #111827;
  --color-text-secondary: #4b5563;
  --color-text-muted: #9ca3af;

  --color-border-subtle: #e5e7eb;
  --color-border-hover: #d1d5db;

  --status-good-text: #15803d;
  --status-good-bg: #ecfdf5;
  --status-good-border: #bbf7d0;

  --status-moderate-text: #b45309;
  --status-moderate-bg: #fffbeb;
  --status-moderate-border: #fde68a;

  --status-elevated-text: #c2410c;
  --status-elevated-bg: #fff7ed;
  --status-elevated-border: #fed7aa;

  --status-poor-text: #b91c1c;
  --status-poor-bg: #fef2f2;
  --status-poor-border: #fecaca;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-dropdown: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --transition-fast: 160ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-primary);
  background-color: var(--color-bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

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

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.app-sidebar {
  width: 220px;
  min-width: 220px;
  background-color: var(--color-sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 24px 8px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.mobile-sidebar-close {
  display: none;
  color: #9ca3af;
  padding: 4px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: #a7f3d0;
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition-fast);
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background-color: var(--color-sidebar-hover);
  color: #ffffff;
}

.nav-item.active {
  background-color: var(--color-sidebar-active);
  color: #ffffff;
  font-weight: 600;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  opacity: 0.85;
}

.nav-item.active .nav-icon {
  opacity: 1;
  color: #34d399;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sign-out-trigger {
  color: #9ca3af;
}

.sign-out-trigger:hover {
  background-color: rgba(220, 38, 38, 0.15);
  color: #fca5a5;
}

.app-main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--color-bg-app);
}

.app-header {
  height: 72px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--color-border-subtle);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.mobile-menu-btn {
  display: none;
  color: var(--color-text-secondary);
}

.greeting-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.greeting-subtitle {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.3;
}

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

.room-selector-wrapper {
  position: relative;
}

.room-selector-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-pill);
  font-weight: 500;
  color: var(--color-text-primary);
  transition: all var(--transition-fast);
}

.room-selector-btn:hover {
  background: #ffffff;
  border-color: var(--color-border-hover);
}

.room-thumb-mini {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  display: block;
}

.room-thumb-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.room-current-name {
  font-size: 13.5px;
  font-weight: 600;
}

.room-chevron {
  color: var(--color-text-muted);
  display: flex;
}

.room-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 240px;
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-dropdown);
  padding: 6px;
  display: none;
  flex-direction: column;
  z-index: 120;
}

.room-dropdown-menu.open {
  display: flex;
}

.room-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-align: left;
  transition: background var(--transition-fast);
}

.room-dropdown-item:hover {
  background-color: var(--color-bg-secondary);
}

.room-dropdown-item.active {
  background-color: var(--color-brand-light);
}

.dropdown-item-thumb {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.dropdown-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dropdown-item-info .item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.dropdown-item-info .item-sub {
  font-size: 11px;
  color: var(--color-text-muted);
}

.item-check {
  color: var(--color-brand-primary);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--color-border-subtle);
  margin: 6px 0;
}

.dropdown-add-room {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-brand-primary);
}

.dropdown-add-room:hover {
  background: var(--color-brand-light);
}

.mode-control-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-control-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.mode-segmented-pill {
  display: flex;
  background: #111827;
  padding: 3px;
  border-radius: var(--radius-pill);
}

.mode-segment-btn {
  padding: 5px 14px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--radius-pill);
  color: #9ca3af;
  transition: all var(--transition-fast);
}

.mode-segment-btn.active {
  background: #0f392b;
  color: #34d399;
}

.mode-status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  position: relative;
}

.status-auto .status-dot {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: pulse-dot 2.2s infinite;
}

.status-manual .status-dot {
  background: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.status-texts {
  display: flex;
  flex-direction: column;
}

.status-primary {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.status-secondary {
  font-size: 11px;
  color: var(--color-text-muted);
}

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

.header-time-pill {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.time-date {
  font-size: 11px;
  color: var(--color-text-muted);
}

.time-clock {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.header-icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.header-icon-btn:hover {
  background-color: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

.notif-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  background-color: var(--color-brand-primary);
  border-radius: 50%;
}

.header-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #111827;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}

.header-avatar-btn:hover {
  transform: scale(1.05);
}

.app-body-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.view-content {
  max-width: 1360px;
  margin: 0 auto;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.metric-indicator-dots {
  display: flex;
  gap: 3px;
}

.metric-mini-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.metric-title {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.metric-body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.metric-source {
  display: block;
  margin-top: 4px;
  color: var(--color-text-secondary);
  font-size: 9px;
  line-height: 1.3;
}

.metric-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.metric-value small {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.metric-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.pill-good {
  background: var(--status-good-bg);
  color: var(--status-good-text);
  border: 1px solid var(--status-good-border);
}

.pill-moderate {
  background: var(--status-moderate-bg);
  color: var(--status-moderate-text);
  border: 1px solid var(--status-moderate-border);
}

.pill-elevated {
  background: var(--status-elevated-bg);
  color: var(--status-elevated-text);
  border: 1px solid var(--status-elevated-border);
}

.pill-poor {
  background: var(--status-poor-bg);
  color: var(--status-poor-text);
  border: 1px solid var(--status-poor-border);
}

.pill-neutral {
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-subtle);
}

.view-content.view-dashboard {
  max-width: 100%;
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 28px;
}

.dashboard-action-toolbar {
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.action-toolbar-left,
.action-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-right: 4px;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.toolbar-btn svg {
  width: 14px;
  height: 14px;
}

.toolbar-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-action-optimize:hover {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

.btn-action-flush:hover {
  background: #f0fdfa;
  border-color: #06b6d4;
  color: #0e7490;
}

.btn-action-eco:hover {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #15803d;
}

.btn-action-seal:hover {
  background: #fff7ed;
  border-color: #ea580c;
  color: #c2410c;
}

.toolbar-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-subtle);
  background: #ffffff;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.toolbar-btn-secondary:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border-color: var(--color-border-hover);
}

.toolbar-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: #0f2920;
  color: #34d399;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
}

.profile-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.8fr 1.6fr 1.5fr 1.6fr;
  gap: 16px;
  align-items: stretch;
}

.dash-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  padding: 16px;
  min-width: 0;
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 28px;
}

.card-head-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.link-btn-view-all {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-brand-primary);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.link-btn-view-all:hover {
  text-decoration: underline;
}

.card-room-view {
  padding: 14px;
}

.room-head-space-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
  white-space: nowrap;
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 600;
  background: #0f2920;
  color: #34d399;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.live-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.room-canvas-container {
  position: relative;
  width: 100%;
  height: 290px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #111827;
}

.room-canvas-hud-top {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  z-index: 10;
  pointer-events: auto;
}

.sim-speed-selector {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.speed-label {
  font-size: 9.5px;
  font-weight: 600;
  color: #94a3b8;
  margin-right: 2px;
}

.sim-speed-btn {
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  color: #cbd5e1;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sim-speed-btn:hover {
  color: #ffffff;
}

.sim-speed-btn.active {
  background: #10b981;
  color: #ffffff;
}

.sim-view-toggle-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 10.5px;
  font-weight: 600;
  color: #e2e8f0;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sim-view-toggle-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: #34d399;
  color: #34d399;
}

.room-canvas-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.94;
  display: block;
}

.airflow-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.room-canvas-overlay-badges {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.room-badge-indicator {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 10px;
  font-weight: 500;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.dot-green {
  background: #10b981;
}

.dot-neutral {
  background: #9ca3af;
}

.room-view-bottom-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border-subtle);
}

.room-stat-mini {
  display: flex;
  flex-direction: column;
}

.stat-mini-label {
  font-size: 10px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.stat-mini-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.decision-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.decision-icon {
  color: var(--color-brand-primary);
  display: flex;
}

.decision-time {
  font-size: 11px;
  color: var(--color-text-muted);
}

.decision-headline {
  margin-bottom: 16px;
}

.decision-headline h3 {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text-primary);
}

.decision-details-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
}

.decision-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  font-size: 12px;
  line-height: 1.45;
}

.decision-label {
  font-weight: 600;
  color: var(--color-text-secondary);
}

.decision-value {
  color: var(--color-text-primary);
}

.decision-compliance-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-top: 10px;
  font-size: 11px;
}

.compliance-tag {
  font-weight: 700;
  color: var(--color-brand-primary);
}

.compliance-confidence {
  color: var(--color-text-muted);
}

.card-actions-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border-subtle);
  width: 100%;
  box-sizing: border-box;
}

.card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  min-height: 34px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  line-height: 1;
  box-sizing: border-box;
  width: 100%;
  letter-spacing: -0.01em;
}

.card-btn svg {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px;
  max-height: 14px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.card-btn span {
  display: inline-block;
  white-space: nowrap;
  line-height: 1;
  vertical-align: middle;
}

.card-btn-primary {
  background: var(--color-brand-primary);
  color: #ffffff;
  border: 1px solid var(--color-brand-primary);
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.15);
}

.card-btn-primary:hover {
  background: var(--color-brand-hover);
  border-color: var(--color-brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(16, 185, 129, 0.25);
}

.card-btn-primary:active {
  transform: translateY(0);
}

.card-btn-outline {
  background: #ffffff;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-subtle);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.card-btn-outline:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border-color: var(--color-border-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.card-btn-outline:active {
  transform: translateY(0);
}

@media (max-width: 480px) {
  .card-actions-footer {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

.card-btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid transparent;
}

.card-btn-ghost:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

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

.device-row-item {
  display: flex;
  gap: 10px;
  padding: 9px 10px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
}

.device-row-item:hover {
  border-color: var(--color-border-hover);
}

.device-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-brand-primary);
  flex-shrink: 0;
}

.device-item-icon svg {
  width: 17px;
  height: 17px;
}

.device-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.device-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.device-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-status-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.device-row-sub {
  font-size: 10.5px;
  color: var(--color-text-muted);
  line-height: 1.3;
}

.device-interactive-controls {
  display: flex;
  gap: 4px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.btn-ctrl {
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.btn-ctrl:hover {
  background: var(--color-bg-secondary);
  color: var(--color-brand-primary);
  border-color: var(--color-brand-primary);
}

.btn-ctrl.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.devices-count-pill {
  font-size: 10.5px;
  font-weight: 600;
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-subtle);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.devices-footer-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--color-border-subtle);
}

.footer-btn-sync,
.footer-btn-standby {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.footer-btn-sync:hover {
  background: #ecfdf5;
  color: #065f46;
  border-color: #10b981;
}

.footer-btn-standby:hover {
  background: #fff7ed;
  color: #c2410c;
  border-color: #ea580c;
}

.activity-badge-live {
  font-size: 10.5px;
  font-weight: 600;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.activity-footer-bar {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--color-border-subtle);
}

.btn-activity-simulate,
.btn-activity-export {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.btn-activity-simulate:hover,
.btn-activity-export:hover {
  background: #ffffff;
  color: var(--color-text-primary);
  border-color: var(--color-border-hover);
}

.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 295px;
  overflow-y: auto;
  padding-right: 4px;
}

.activity-card-item {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
}

.activity-card-item:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-sm);
}

.activity-icon-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon-avatar svg {
  width: 15px;
  height: 15px;
}

.activity-item-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.activity-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.activity-source-pill {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}

.activity-source-pill.source-system,
.activity-source-pill.source-auto {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.activity-source-pill.source-you,
.activity-source-pill.source-manual {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.activity-source-pill.source-quick_flush,
.activity-source-pill.source-flush {
  background: #f0fdfa;
  color: #0e7490;
  border: 1px solid #a5f3fc;
}

.activity-source-pill.source-eco_mode,
.activity-source-pill.source-eco {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.activity-source-pill.source-perimeter_seal,
.activity-source-pill.source-seal,
.activity-source-pill.source-preset_smog {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.activity-source-pill.source-clean_shield,
.activity-source-pill.source-preset_shield {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.activity-timestamp {
  font-size: 10px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.activity-action-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.3;
}

.activity-detail-desc {
  font-size: 10.5px;
  color: var(--color-text-secondary);
  line-height: 1.3;
}

.act-state-transition {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 2px 0;
}

.state-pill {
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

.state-from {
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-subtle);
}

.state-arrow {
  font-size: 10px;
  color: var(--color-text-muted);
}

.state-to {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.activity-live-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10b981;
  margin-right: 3px;
  animation: pulse-dot 2s infinite;
}

.modal-dialog-lg {
  width: 100%;
  max-width: 820px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.standards-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-border-subtle);
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  flex-shrink: 0;
}

.modal-header-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.standards-shield-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.12);
}

.standards-dialog-title {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  line-height: 1.25;
}

.standards-dialog-sub {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 3px 0 0 0;
  line-height: 1.35;
}

.standards-modal-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
  background: #ffffff;
}

.standards-scoreboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.score-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.score-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.score-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.score-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-primary);
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1.15;
}

.score-val small {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.score-meta {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.score-card.score-status .score-val {
  color: #059669;
}

.score-badge.badge-pass {
  font-size: 9.5px;
  font-weight: 700;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  width: fit-content;
  letter-spacing: 0.03em;
  margin-top: 2px;
}

.standards-formula-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.formula-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.formula-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.formula-standard {
  font-size: 11px;
  color: var(--color-text-muted);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 500;
}

.formula-math {
  font-size: 18px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #0f766e;
  background: #ffffff;
  border: 1px solid #ccfbf1;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  letter-spacing: 0.02em;
}

.formula-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legend-pill {
  font-size: 11px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  color: var(--color-text-secondary);
}

.legend-pill strong {
  color: var(--color-text-primary);
}

.standards-safeguards-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.standards-rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.std-rule-item {
  display: flex;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.std-rule-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.rule-icon-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.box-amber { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.box-cyan { background: #f0fdfa; color: #0891b2; border: 1px solid #a5f3fc; }
.box-green { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.box-purple { background: #f5f3ff; color: #7c3aed; border: 1px solid #ddd6fe; }

.rule-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.rule-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.rule-desc {
  font-size: 11px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  margin: 0;
}

.rule-status-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  width: fit-content;
  margin-top: 3px;
}

.tag-active {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.tag-nominal {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.standards-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border-subtle);
  background: #f8fafc;
  margin-top: 0;
  flex-shrink: 0;
}

.standards-modal-footer .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.standards-modal-footer .btn-secondary {
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
}

.standards-modal-footer .btn-secondary:hover {
  background: #f1f5f9;
  color: var(--color-text-primary);
  border-color: #cbd5e1;
}

.standards-modal-footer .btn-primary {
  background: var(--color-brand-primary);
  color: #ffffff;
  border: 1px solid transparent;
}

.standards-modal-footer .btn-primary:hover {
  filter: brightness(1.08);
}

.dashboard-diagnostics-deck {
  display: grid;
  grid-template-columns: 1.6fr 1.3fr 1.7fr;
  gap: 18px;
  align-items: stretch;
  margin-top: 2px;
}

.diag-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.diag-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.diag-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.diag-icon {
  color: var(--color-brand-primary);
  display: flex;
}

.diag-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

.diag-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.badge-reduction {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-healthy {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-preset {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.differential-bar-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.diff-bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 65px;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}

.diff-bar-label {
  font-weight: 500;
  color: var(--color-text-secondary);
}

.diff-bar-track {
  height: 8px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.diff-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.8s ease-out;
}

.fill-outdoor {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.fill-indoor {
  background: linear-gradient(90deg, #10b981, #059669);
}

.diff-bar-val {
  font-weight: 700;
  text-align: right;
  color: var(--color-text-primary);
}

.diff-bar-val.val-clean {
  color: #059669;
}

.diff-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--color-border-subtle);
}

.diff-stat-item {
  display: flex;
  flex-direction: column;
}

.diff-stat-item .stat-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.diff-stat-item .stat-desc {
  font-size: 10px;
  color: var(--color-text-muted);
}

.sensor-health-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.sensor-health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-subtle);
}

.sensor-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sensor-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.sensor-status {
  font-size: 10.5px;
}

.text-green {
  color: #059669;
}

.sensor-indicator-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.pill-ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.diag-footer-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--color-border-subtle);
}

.btn-diag-run,
.btn-diag-reset {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.btn-diag-run:hover,
.btn-diag-reset:hover {
  background: #ffffff;
  color: var(--color-text-primary);
  border-color: var(--color-border-hover);
}

.diag-desc {
  font-size: 11.5px;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
  line-height: 1.35;
}

.presets-button-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: auto;
}

.preset-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  text-align: left;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.preset-btn:hover {
  background: #ffffff;
  border-color: var(--color-brand-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.preset-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-brand-primary);
  flex-shrink: 0;
}

.preset-text {
  display: flex;
  flex-direction: column;
}

.preset-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.preset-sub {
  font-size: 10px;
  color: var(--color-text-muted);
}

@media (max-width: 1400px) {
  .dashboard-grid {
    grid-template-columns: 1.8fr 1.5fr 1.35fr 1.35fr;
  }
  .dashboard-diagnostics-deck {
    grid-template-columns: 1fr 1fr;
  }
  .diag-card-presets {
    grid-column: span 2;
  }
}

@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-diagnostics-deck {
    grid-template-columns: 1fr;
  }
  .diag-card-presets {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-action-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

.view-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.page-subtitle {
  font-size: 12.5px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.btn-primary {
  background-color: var(--color-brand-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--color-brand-hover);
}

.btn-outline {
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-primary);
}

.btn-outline:hover {
  border-color: var(--color-border-hover);
  background: var(--color-bg-secondary);
}

.btn-danger {
  background-color: #dc2626;
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-amber {
  background-color: #d97706;
  color: #ffffff;
}

.btn-amber:hover {
  background-color: #b45309;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11.5px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

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

.space-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.space-card-media {
  position: relative;
  height: 180px;
  width: 100%;
}

.space-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.space-mode-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.mode-auto {
  background: rgba(16, 185, 129, 0.9);
  color: #ffffff;
}

.mode-manual {
  background: rgba(217, 119, 6, 0.9);
  color: #ffffff;
}

.space-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.space-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.space-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.space-meta {
  font-size: 11.5px;
  color: var(--color-text-muted);
}

.space-menu-actions {
  display: flex;
  gap: 4px;
}

.icon-action-btn {
  padding: 4px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  display: flex;
  transition: all var(--transition-fast);
}

.icon-action-btn:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
}

.space-metrics-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 14px;
}

.space-metric-item {
  display: flex;
  flex-direction: column;
}

.space-metric-item .lbl {
  font-size: 10.5px;
  color: var(--color-text-muted);
}

.space-metric-item .val {
  font-size: 13px;
  font-weight: 700;
}

.space-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.sim-presets-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
}

.presets-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.preset-btn {
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-primary);
  transition: all var(--transition-fast);
}

.preset-btn:hover {
  background: var(--color-brand-light);
  border-color: var(--color-brand-border);
  color: var(--color-brand-primary);
}

.simulation-layout {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 20px;
}

.sim-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.sim-section-title {
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 18px;
}

.sim-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}

.sim-control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.control-label-row label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.control-value-display {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-brand-primary);
}

.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-brand-primary);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform var(--transition-fast);
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--color-text-muted);
}

.sim-decision-box {
  display: flex;
  gap: 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 18px;
}

.decision-icon-badge {
  color: var(--color-brand-primary);
  flex-shrink: 0;
}

.decision-main-title {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 4px;
}

.decision-main-reason {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.sim-actuation-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.preview-item {
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.preview-item .p-label {
  font-size: 10.5px;
  color: var(--color-text-muted);
}

.preview-item .p-value {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-brand-primary);
  margin-top: 2px;
}

.sim-expected-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 12px;
}

.exp-title {
  font-size: 11px;
  font-weight: 700;
  color: #166534;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.exp-text {
  font-size: 12px;
  color: #15803d;
  margin-top: 2px;
}

.analytics-time-pills {
  display: flex;
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-pill);
  padding: 2px;
}

.time-filter-btn {
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  color: var(--color-text-secondary);
}

.time-filter-btn.active {
  background: var(--color-brand-primary);
  color: #ffffff;
}

.analytics-chart-card {
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.chart-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

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

.chart-title {
  font-size: 14px;
  font-weight: 700;
}

.chart-metric-select {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-subtle);
  font-size: 12px;
  color: var(--color-text-primary);
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--color-text-secondary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.canvas-chart-wrapper {
  width: 100%;
  height: 300px;
}

#analytics-chart-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.analytics-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  margin: 4px 0 2px 0;
  color: var(--color-text-primary);
}

.stat-sub {
  font-size: 11px;
  color: var(--color-text-muted);
}

.devices-table-card {
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.devices-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.devices-table th {
  padding: 12px 16px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border-subtle);
}

.devices-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: 13px;
  vertical-align: middle;
}

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

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

.cell-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
}

.cell-dev-name {
  display: block;
  font-weight: 600;
}

.cell-dev-id {
  font-size: 11px;
  color: var(--color-text-muted);
}

.room-pill {
  padding: 3px 8px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 500;
}

.conn-badge {
  font-size: 11px;
  font-weight: 600;
}

.conn-connected { color: #16a34a; }
.conn-connecting { color: #d97706; }
.conn-offline { color: #dc2626; }

.state-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-secondary);
}

.state-open, .state-active, .state-normal, .state-high, .state-filtered {
  background: var(--color-brand-light);
  color: var(--color-brand-primary);
}

.settings-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 720px;
}

.settings-card {
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.settings-card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.settings-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.segmented-choice {
  display: flex;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 4px;
}

.choice-btn {
  flex: 1;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
}

.choice-btn.active {
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  color: var(--color-brand-primary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  border-radius: 24px;
  transition: .3s;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: .3s;
}

input:checked + .slider-round {
  background-color: var(--color-brand-primary);
}

input:checked + .slider-round:before {
  transform: translateX(20px);
}

.settings-select {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: #ffffff;
}

.auth-page-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  background: #ffffff;
}

.auth-media-pane {
  position: relative;
  flex: 1.1;
  height: 100%;
  overflow: hidden;
  background: #111827;
}

.auth-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

.auth-media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 35, 26, 0.92) 0%, rgba(11, 35, 26, 0.3) 60%, rgba(11, 35, 26, 0.1) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  color: #ffffff;
}

.auth-brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-brand-icon {
  width: 32px;
  height: 32px;
  background: rgba(52, 211, 153, 0.25);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #34d399;
}

.auth-brand-title {
  font-size: 18px;
  font-weight: 700;
}

.auth-hero-copy {
  max-width: 440px;
}

.auth-hero-heading {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.auth-hero-sub {
  font-size: 15px;
  line-height: 1.5;
  color: #a7f3d0;
}

.auth-hero-footer {
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: #6ee7b7;
  text-transform: uppercase;
}

.auth-form-pane {
  flex: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: #ffffff;
}

.auth-form-inner {
  width: 100%;
  max-width: 380px;
}

.auth-form-header {
  margin-bottom: 24px;
}

.auth-form-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.auth-form-sub {
  font-size: 13.5px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.form-field input, .modal-form-fields input {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: #ffffff;
  font-size: 13.5px;
  transition: border-color var(--transition-fast);
}

.form-field input:focus, .modal-form-fields input:focus {
  border-color: var(--color-brand-primary);
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field-link {
  font-size: 11.5px;
  color: var(--color-brand-primary);
  font-weight: 500;
}

.input-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-password-wrapper input {
  width: 100%;
  padding-right: 44px !important;
}

.btn-toggle-pw {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
  z-index: 2;
}

.btn-toggle-pw:hover {
  color: var(--color-text-primary);
  background: rgba(0, 0, 0, 0.05);
}

.btn-google-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 11px 16px;
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: #3c4043;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s, border-color 0.2s, transform 0.1s;
  margin-bottom: 4px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}

.btn-google-auth:hover {
  background: #f8f9fa;
  border-color: #c6c9ce;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.16);
  transform: translateY(-0.5px);
}

.btn-google-auth:active {
  background: #eeeeee;
  transform: translateY(0);
}

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

.google-btn-text {
  font-family: var(--font-sans);
  letter-spacing: 0.01em;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 20px 0;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.auth-divider-text {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.form-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.btn-auth-submit {
  margin-top: 8px;
  padding: 12px;
  font-size: 14px;
}

.auth-form-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12.5px;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.link-btn-toggle-auth {
  color: var(--color-brand-primary);
  font-weight: 600;
}

.mobile-only-logo {
  display: none;
}

.onboarding-page-container {
  min-height: 100vh;
  background: var(--color-bg-app);
  display: flex;
  flex-direction: column;
}

.onboarding-header {
  padding: 24px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border-subtle);
}

.onboarding-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.onboarding-stepper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.step-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.step-item.active .step-circle {
  background: var(--color-brand-primary);
  color: #ffffff;
}

.step-item.active {
  color: var(--color-brand-primary);
  font-weight: 600;
}

.step-item.completed .step-circle {
  background: #16a34a;
  color: #ffffff;
}

.step-line {
  width: 32px;
  height: 2px;
  background: #e5e7eb;
}

.step-line.filled {
  background: #16a34a;
}

.onboarding-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.onboarding-content-card {
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: 36px;
  max-width: 820px;
  width: 100%;
  box-shadow: var(--shadow-sm);
}

.onboarding-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.onboarding-subtitle {
  font-size: 13.5px;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.onboarding-spaces-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.onboarding-room-card {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.onb-room-meta {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.onb-room-meta strong {
  font-size: 13px;
}

.onb-room-meta span {
  font-size: 11.5px;
  color: var(--color-text-secondary);
}

.onb-room-meta small {
  font-size: 10.5px;
  color: var(--color-text-muted);
}

.onb-room-img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.onboarding-add-card {
  border: 2px dashed var(--color-border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--color-brand-primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 20px;
  transition: all var(--transition-fast);
}

.onboarding-add-card:hover {
  background: var(--color-brand-light);
  border-color: var(--color-brand-primary);
}

.onboarding-actions-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.ready-step-card {
  max-width: 500px;
  text-align: center;
}

.ready-check-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-brand-light);
  color: var(--color-brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modal-appear 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-appear {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-space-dialog {
  width: 760px;
  max-width: 90vw;
  flex-direction: row;
}

.modal-sidebar-stepper {
  width: 190px;
  background: var(--color-bg-secondary);
  border-right: 1px solid var(--color-border-subtle);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-step-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.modal-step-tab:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--color-text-primary);
}

.modal-step-tab.active {
  background: #ffffff;
  color: var(--color-brand-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.modal-step-tab.completed .step-num-pill {
  background: #16a34a;
  color: #ffffff;
}

.step-num-pill {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e5e7eb;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.step-num-pill svg {
  width: 12px;
  height: 12px;
}

.modal-step-tab.active .step-num-pill {
  background: var(--color-brand-primary);
  color: #ffffff;
}

.space-step-pane {
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.calc-metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 8px 0 16px 0;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
}

.calc-metric-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calc-metric-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calc-metric-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-brand-primary);
}

.devices-config-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.device-config-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease;
}

.device-config-item:hover {
  border-color: var(--color-border-hover);
}

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

.device-config-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--color-bg-secondary);
  color: var(--color-brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.device-config-icon svg {
  width: 18px;
  height: 18px;
}

.device-config-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.device-config-desc {
  font-size: 11.5px;
  color: var(--color-text-muted);
}

.review-summary-card {
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.review-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.review-room-name-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-name-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.review-type-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--color-bg-secondary);
  color: var(--color-brand-primary);
}

.review-grid-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.review-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.review-label {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.review-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.review-ashrae-banner {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #065f46;
}

.modal-main-content {
  flex: 1;
  padding: 28px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
}

.modal-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 20px;
  line-height: 1;
  transition: all 0.15s ease;
  padding: 0;
}

.modal-close-btn:hover {
  background: #f1f5f9;
  color: var(--color-text-primary);
}

.modal-form-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-subtle);
}

.modal-sm-dialog {
  max-width: 400px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  text-align: center;
  border-radius: var(--radius-lg);
}

.confirm-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
}

.icon-amber {
  background: #fef3c7;
  color: #d97706;
}

.icon-green {
  background: #ecfdf5;
  color: #15803d;
}

.confirm-modal-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.confirm-modal-text {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.45;
  margin-bottom: 20px;
}

.confirm-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.modal-signout-card {
  width: 340px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-radius: var(--radius-lg);
}

.signout-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.signout-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.signout-text {
  font-size: 12.5px;
  color: var(--color-text-secondary);
  line-height: 1.45;
  margin-bottom: 22px;
}

.signout-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 300;
}

.toast-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #111827;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px);
  transition: all var(--transition-normal);
}

.toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-hide {
  opacity: 0;
  transform: translateY(10px);
}

.toast-success .toast-icon { color: #34d399; }
.toast-warning .toast-icon { color: #f59e0b; }
.toast-info .toast-icon { color: #60a5fa; }

.toast-close {
  color: #9ca3af;
  font-size: 16px;
  margin-left: 6px;
}

.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.mb-3 { margin-bottom: 12px; }

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

@media (max-width: 900px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
  }
  .app-sidebar.mobile-open {
    transform: translateX(0);
  }
  .mobile-menu-btn {
    display: block;
  }
  .mobile-sidebar-close {
    display: block;
  }
  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .simulation-layout {
    grid-template-columns: 1fr;
  }
  .header-center {
    gap: 10px;
  }
  .mode-status-indicator {
    display: none;
  }
  .auth-media-pane {
    display: none;
  }
  .onboarding-spaces-grid {
    grid-template-columns: 1fr 1fr;
  }
  .analytics-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
  .app-header {
    padding: 0 16px;
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .header-center {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
  .spaces-grid {
    grid-template-columns: 1fr;
  }
  .sim-controls-grid {
    grid-template-columns: 1fr;
  }
  .onboarding-spaces-grid {
    grid-template-columns: 1fr;
  }
}

.assistant-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.assistant-sparkle-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-brand-primary);
}

.assistant-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.assistant-context-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.ctx-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot-green {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.dot-amber {
  background: #d97706;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
}

.assistant-workspace-card {
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 165px);
  min-height: 540px;
  overflow: hidden;
}

.assistant-suggestions-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border-subtle);
}

.sugg-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.sugg-chips-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}

.sugg-chips-scroll::-webkit-scrollbar {
  display: none;
}

.chat-suggestion-chip {
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-primary);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.chat-suggestion-chip:hover {
  background: var(--color-brand-light);
  border-color: var(--color-brand-border);
  color: var(--color-brand-primary);
  transform: translateY(-1px);
}

.assistant-chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-message-row {
  display: flex;
  gap: 12px;
  max-width: 82%;
  animation: chat-msg-appear 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chat-msg-appear {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-message-row.msg-bot {
  align-self: flex-start;
}

.chat-message-row.msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
}

.msg-bot .chat-avatar {
  background: #0f392b;
  color: #34d399;
}

.msg-user .chat-avatar {
  background: #111827;
  color: #ffffff;
}

.chat-bubble {
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.msg-bot .chat-bubble {
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-primary);
}

.msg-user .chat-bubble {
  background: #0f392b;
  border: 1px solid #14532d;
  color: #ffffff;
}

.chat-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.chat-author {
  font-size: 11.5px;
  font-weight: 700;
}

.msg-bot .chat-author {
  color: var(--color-brand-primary);
}

.msg-user .chat-author {
  color: #a7f3d0;
}

.chat-timestamp {
  font-size: 10.5px;
  color: var(--color-text-muted);
}

.msg-user .chat-timestamp {
  color: #6ee7b7;
  opacity: 0.75;
}

.chat-body-text {
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

.msg-user .chat-body-text {
  color: #ffffff;
}

.chat-heading {
  font-size: 13.5px;
  font-weight: 700;
  margin: 12px 0 6px 0;
  color: #0f392b;
}

.chat-list {
  margin: 6px 0 8px 18px;
  padding: 0;
}

.chat-bullet {
  margin-bottom: 3px;
}

.chat-action-badge {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: #15803d;
  align-self: flex-start;
}

.chat-action-badge .badge-icon {
  font-weight: 700;
  color: #16a34a;
}

.chat-action-badge .badge-tag {
  font-weight: 700;
}

.chat-action-badge .badge-detail {
  color: #166534;
}

.chat-action-badge.action-failed,
.mini-action-tag.action-failed {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.assistant-composer-form {
  padding: 14px 20px;
  background: #ffffff;
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
}

.composer-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 10px 6px 14px;
  transition: all var(--transition-fast);
}

.composer-input-wrapper:focus-within {
  background: #ffffff;
  border-color: var(--color-brand-primary);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.12);
}

.composer-textarea {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--color-text-primary);
  resize: none;
  outline: none;
  line-height: 1.4;
  height: 24px;
  max-height: 120px;
}

.btn-send-prompt {
  padding: 7px 16px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

.composer-footnote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--color-text-muted);
  padding: 0 4px;
}

.keyboard-hint {
  font-weight: 500;
  opacity: 0.8;
}

.floating-assistant-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 250;
}

.app-layout:has(.view-assistant) ~ .floating-assistant-wrapper,
body:has(.view-assistant) .floating-assistant-wrapper {
  display: none !important;
}

.floating-assistant-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #0f392b;
  color: #ffffff;
  border-radius: var(--radius-pill);
  box-shadow: 0 6px 20px rgba(15, 57, 43, 0.35);
  border: 1px solid #166534;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-normal);
}

.floating-assistant-btn:hover {
  transform: translateY(-2px);
  background: #144937;
  box-shadow: 0 8px 24px rgba(15, 57, 43, 0.45);
}

.fab-sparkle {
  color: #34d399;
  display: flex;
}

.fab-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.floating-chat-drawer {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 380px;
  height: 530px;
  max-height: calc(100vh - 100px);
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  border-radius: 18px;
  box-shadow: var(--shadow-modal);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 260;
}

.floating-chat-drawer.open {
  display: flex;
  animation: drawer-slide-up 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes drawer-slide-up {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.floating-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #0f392b;
  color: #ffffff;
}

.drawer-head-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-head-title .drawer-icon {
  color: #34d399;
  display: flex;
}

.drawer-head-title strong {
  font-size: 13px;
  display: block;
  line-height: 1.2;
}

.drawer-head-title .drawer-sub {
  font-size: 10.5px;
  color: #a7f3d0;
  display: block;
}

.drawer-head-actions {
  display: flex;
  gap: 4px;
}

.drawer-btn {
  color: #9ca3af;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  transition: all var(--transition-fast);
}

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

.floating-drawer-suggestions {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}

.floating-drawer-suggestions::-webkit-scrollbar {
  display: none;
}

.mini-chip {
  padding: 3px 9px;
  font-size: 10.5px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.mini-chip:hover {
  background: var(--color-brand-light);
  border-color: var(--color-brand-border);
  color: var(--color-brand-primary);
}

.floating-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f9fafb;
}

.mini-chat-msg {
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.45;
  max-width: 88%;
  display: flex;
  flex-direction: column;
}

.mini-msg-bot {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-primary);
}

.mini-msg-user {
  align-self: flex-end;
  background: #0f392b;
  border: 1px solid #14532d;
  color: #ffffff;
}

.mini-action-tag {
  margin-top: 6px;
  font-size: 10.5px;
  font-weight: 600;
  color: #15803d;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
  align-self: flex-start;
}

.floating-drawer-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #ffffff;
  border-top: 1px solid var(--color-border-subtle);
}

.floating-drawer-composer input {
  flex: 1;
  padding: 7px 12px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
}

.floating-drawer-composer input:focus {
  border-color: var(--color-brand-primary);
}

.drawer-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-brand-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.drawer-send-btn:hover {
  background: var(--color-brand-hover);
}

.google-auth-backdrop {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1050;
  animation: fadeIn 0.2s ease-out;
}

.google-auth-dialog {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.22), 0 0 1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.google-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.google-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.google-service-name {
  font-size: 13px;
  font-weight: 500;
  color: #5f6368;
}

.google-modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #70757a;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.google-modal-close:hover {
  background: #f1f3f4;
  color: #202124;
}

.google-dialog-body {
  padding: 24px;
}

.google-dialog-title {
  font-size: 20px;
  font-weight: 600;
  color: #202124;
  margin: 0 0 4px 0;
}

.google-dialog-sub {
  font-size: 13px;
  color: #5f6368;
  margin: 0 0 20px 0;
}

.google-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.google-account-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease-out;
}

.google-account-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.google-avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1a73e8;
  color: #ffffff;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.google-avatar-circle.google-avatar-ghost {
  background: #f1f5f9;
  color: #475569;
  border: 1px dashed #cbd5e1;
}

.custom-google-form {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
}

.google-account-info {
  flex: 1;
  min-width: 0;
}

.google-user-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.google-user-email {
  display: block;
  font-size: 12px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.google-active-indicator {
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.google-dialog-footer-text {
  font-size: 11px;
  line-height: 1.5;
  color: #64748b;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

.google-dialog-footer-text a {
  color: #1a73e8;
  text-decoration: none;
}

.google-dialog-footer-text a:hover {
  text-decoration: underline;
}

.dashboard-telemetry-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: linear-gradient(90deg, #ecfdf5, #f0fdf4 60%, #ecfdf5);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.06);
  animation: bannerSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes bannerSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.telemetry-banner-left {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: #065f46;
  font-weight: 500;
}

.telemetry-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: telemetryPulse 1.8s infinite;
}

@keyframes telemetryPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 7px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.telemetry-scan-track {
  width: 140px;
  height: 5px;
  background: #d1fae5;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.telemetry-scan-progress {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 10px;
  animation: scanProgress 1.4s ease-in-out infinite;
  transform-origin: left;
}

@keyframes scanProgress {
  0% { transform: scaleX(0.15) translateX(0); }
  50% { transform: scaleX(0.7) translateX(30%); }
  100% { transform: scaleX(0.15) translateX(120%); }
}

.telemetry-banner-right {
  font-size: 11px;
  font-weight: 600;
  color: #047857;
  letter-spacing: 0.02em;
}

.dashboard-loading-anim .dash-card {
  animation: dashCardEnter 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.dashboard-loading-anim .dash-card:nth-child(1) { animation-delay: 0.04s; }
.dashboard-loading-anim .dash-card:nth-child(2) { animation-delay: 0.10s; }
.dashboard-loading-anim .dash-card:nth-child(3) { animation-delay: 0.16s; }
.dashboard-loading-anim .dash-card:nth-child(4) { animation-delay: 0.22s; }

@keyframes dashCardEnter {
  0% {
    opacity: 0;
    transform: translateY(9px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-loading-anim .metric-card {
  position: relative;
  overflow: hidden;
  animation: metricCardPulse 0.4s ease-out both;
}

.dashboard-loading-anim .metric-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.16), transparent);
  animation: metricShimmer 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s forwards;
  pointer-events: none;
}

@keyframes metricCardPulse {
  0% {
    opacity: 0.4;
    transform: scale(0.98);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes metricShimmer {
  0% { left: -100%; }
  100% { left: 220%; }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.google-setup-hint-row {
  margin: 10px 0 16px 0;
  display: flex;
  justify-content: center;
}

.btn-text-setup {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  font-size: 11.5px;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.btn-text-setup:hover {
  color: var(--color-brand-primary);
  background: rgba(16, 185, 129, 0.08);
}

.btn-text-setup svg {
  width: 14px;
  height: 14px;
}

.google-setup-dialog {
  background: #ffffff;
  border-radius: 18px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 50px -12px rgba(15, 23, 42, 0.25), 0 0 1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.google-setup-body {
  padding: 22px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setup-intro-banner {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #475569;
}

.setup-intro-icon {
  color: #1a73e8;
  display: flex;
  align-items: flex-start;
  padding-top: 2px;
}

.setup-origin-code {
  background: #e2e8f0;
  color: #0f172a;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 11px;
}

.setup-error-helper {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 12px 14px;
}

.helper-badge {
  display: inline-block;
  background: #f59e0b;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.helper-text {
  font-size: 12px;
  line-height: 1.5;
  color: #78350f;
}

.helper-text strong {
  color: #451a03;
}

.helper-text ul {
  margin: 6px 0 0 16px;
  padding: 0;
}

.helper-text li {
  margin-bottom: 4px;
}

.highlight-current-origin {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
}

.badge-current-origin {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #059669;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.setup-steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setup-step-card {
  display: flex;
  gap: 14px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  transition: border-color 0.15s ease;
}

.setup-step-card:hover {
  border-color: #cbd5e1;
}

.step-num-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1a73e8;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-card-content {
  flex: 1;
  min-width: 0;
}

.step-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 3px;
}

.step-card-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

.step-tip-text {
  display: inline-block;
  margin-top: 4px;
  color: #0d9488;
  font-size: 11px;
}

.btn-step-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 12px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #1e293b;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-step-action:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.step-origins-copy-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.origin-copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.origin-copy-row code {
  font-family: monospace;
  font-size: 11.5px;
  color: #0f172a;
}

.btn-copy-origin {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-copy-origin:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.setup-input-wrapper {
  margin-top: 8px;
}

.setup-clientid-input {
  width: 100%;
  font-family: monospace;
  font-size: 12px;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
}

.setup-clientid-input:focus {
  background: #ffffff;
  border-color: #1a73e8;
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.setup-actions-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.btn-save-gsi {
  padding: 12px;
  font-size: 13.5px;
  font-weight: 600;
  background: #1a73e8;
  border-color: #1a73e8;
}

.btn-save-gsi:hover {
  background: #1557b0;
  border-color: #1557b0;
}

.setup-secondary-actions {
  display: flex;
  justify-content: center;
}

.btn-link-demo {
  background: transparent;
  border: none;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 8px;
}

.btn-link-demo:hover {
  color: #1e293b;
}

.gsi-container {
  display: flex;
  justify-content: center;
}

@media (max-width: 768px) {
  .modal-dialog-lg {
    max-width: 95vw;
    margin: 10px;
  }

  .standards-modal-header {
    padding: 16px 18px;
  }

  .standards-modal-body {
    padding: 18px 16px;
    gap: 16px;
  }

  .standards-scoreboard {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .standards-rules-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .formula-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .formula-math {
    font-size: 15px;
    overflow-x: auto;
  }

  .standards-modal-footer {
    padding: 14px 18px;
    flex-direction: column-reverse;
    gap: 10px;
  }

  .standards-modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
}
