:root,
:root[data-theme=dark] {
  --bg-base: #07101a;
  --bg-elevated: #0f1f2c;
  --bg-raised: #14293a;
  --bg-overlay: rgba(8, 18, 28, 0.78);
  --bg-glass: rgba(15, 31, 44, 0.55);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text-primary: #e6f7fa;
  --text-secondary: #88a3b0;
  --text-muted: #5b7785;
  --text-inverse: #07101a;
  --accent-primary: #2dd4bf;
  --accent-primary-hover: #5eead4;
  --accent-primary-active: #14b8a6;
  --accent-secondary: #38bdf8;
  --accent-glow: rgba(45, 212, 191, 0.32);
  --accent-glow-strong: rgba(45, 212, 191, 0.55);
  --status-online: #34d399;
  --status-offline: #475569;
  --status-warn: #fbbf24;
  --status-danger: #f87171;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 24px var(--accent-glow);
}

:root[data-theme=light] {
  --bg-base: #f1f7f9;
  --bg-elevated: #ffffff;
  --bg-raised: #f8fbfc;
  --bg-overlay: rgba(255, 255, 255, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.7);
  --border-subtle: rgba(15, 45, 47, 0.08);
  --border-strong: rgba(15, 45, 47, 0.16);
  --text-primary: #0a1f24;
  --text-secondary: #4d6a78;
  --text-muted: #7d99a4;
  --text-inverse: #ffffff;
  --accent-primary: #0d9488;
  --accent-primary-hover: #14b8a6;
  --accent-primary-active: #0f766e;
  --accent-secondary: #0ea5e9;
  --accent-glow: rgba(13, 148, 136, 0.22);
  --accent-glow-strong: rgba(13, 148, 136, 0.4);
  --status-online: #16a34a;
  --status-offline: #94a3b8;
  --status-warn: #d97706;
  --status-danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(15, 45, 47, 0.08);
  --shadow-md: 0 4px 14px rgba(15, 45, 47, 0.12);
  --shadow-lg: 0 12px 32px rgba(15, 45, 47, 0.18);
  --shadow-glow: 0 0 18px var(--accent-glow);
}

:root {
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-8: 48px;
  --font-sans:
      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
      sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  --nav-height: 60px;
  --sidebar-width: 340px;
  --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

button {
  font: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
}
a:hover {
  color: var(--accent-primary-hover);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 600;
  color: var(--text-primary);
}

.app-shell {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-5);
  background: var(--bg-overlay);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}
.app-shell .brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.app-shell .brand .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  box-shadow: var(--shadow-glow);
  color: var(--text-inverse);
  font-weight: 800;
}
.app-shell .nav-spacer {
  flex: 1;
}
.app-shell .primary-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.app-shell .primary-nav-item {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.app-shell .primary-nav-item:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}
.app-shell .primary-nav-item.active {
  background: var(--bg-glass);
  color: var(--accent-primary);
  border-color: var(--border-subtle);
}
.app-shell .nav-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.app-shell .nav-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.app-shell .nav-button:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}
.app-shell .org-switcher {
  position: relative;
}
.app-shell .org-switcher .org-switcher-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-weight: 500;
  transition: all var(--transition-fast);
}
.app-shell .org-switcher .org-switcher-trigger:hover {
  border-color: var(--accent-primary);
}
.app-shell .org-switcher .org-switcher-trigger .caret {
  opacity: 0.6;
  margin-left: var(--space-1);
}
.app-shell .user-menu {
  position: relative;
}
.app-shell .user-menu .user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 10px 6px 6px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}
.app-shell .user-menu .user-menu-trigger:hover {
  background: var(--bg-glass);
}
.app-shell .user-menu .user-menu-trigger .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--text-inverse);
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.app-shell .dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: var(--space-2);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: all var(--transition-fast);
}
.app-shell .dropdown.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.app-shell .dropdown .dropdown-header {
  padding: var(--space-2) var(--space-3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.app-shell .dropdown .dropdown-search {
  padding: var(--space-1) var(--space-2) var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
}
.app-shell .dropdown .dropdown-search input {
  width: 100%;
  padding: 6px 10px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
}
.app-shell .dropdown .dropdown-search input:focus {
  border-color: var(--accent-primary);
}
.app-shell .dropdown .dropdown-scroll {
  max-height: 260px;
  overflow-y: auto;
}
.app-shell .dropdown .dropdown-scroll::-webkit-scrollbar {
  width: 6px;
}
.app-shell .dropdown .dropdown-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.app-shell .dropdown .dropdown-scroll::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}
.app-shell .dropdown .dropdown-empty {
  padding: var(--space-3) var(--space-3);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
.app-shell .dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 8px var(--space-3);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-align: left;
}
.app-shell .dropdown .dropdown-item:hover {
  background: var(--bg-glass);
}
.app-shell .dropdown .dropdown-item.active {
  color: var(--accent-primary);
}
.app-shell .dropdown .dropdown-divider {
  height: 1px;
  margin: var(--space-2) 0;
  background: var(--border-subtle);
  border: 0;
}

.login-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-5);
  overflow: hidden;
}
.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 30%, rgba(45, 212, 191, 0.18) 0%, transparent 50%), radial-gradient(ellipse at 85% 70%, rgba(56, 189, 248, 0.16) 0%, transparent 55%), radial-gradient(ellipse at 50% 100%, rgba(45, 212, 191, 0.1) 0%, transparent 60%);
  pointer-events: none;
}
.login-page::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40"><circle cx="20" cy="20" r="0.8" fill="rgba(255,255,255,0.04)"/></svg>');
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: var(--space-6);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
.login-card .login-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.login-card .login-brand .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  box-shadow: var(--shadow-glow);
  color: var(--text-inverse);
  font-weight: 800;
  font-size: 22px;
}
.login-card .login-brand .brand-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.login-card .login-brand .brand-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.login-card h1 {
  margin: 0 0 var(--space-2);
  font-size: 24px;
}
.login-card .login-subtitle {
  margin-bottom: var(--space-5);
  color: var(--text-secondary);
}
.login-card .form-row {
  margin-bottom: var(--space-4);
}
.login-card .submit {
  width: 100%;
  margin-top: var(--space-3);
  padding: 12px;
  font-size: 15px;
}
.login-card .login-footer {
  margin-top: var(--space-5);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.login-card .login-forgot {
  margin-top: var(--space-3);
  text-align: center;
}
.login-card .login-forgot-link {
  background: transparent;
  border: none;
  padding: 4px 8px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: underline;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.login-card .login-forgot-link:hover:not(:disabled) {
  color: var(--accent-primary);
}
.login-card .login-forgot-link:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.robot-map {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--bg-base);
  overflow: hidden;
}

.robot-map-canvas {
  position: absolute;
  inset: 0;
}

:root[data-theme=dark] .leaflet-tile-pane {
  filter: brightness(0.65) contrast(1.05) hue-rotate(180deg) invert(0.93);
}

.leaflet-container {
  background: var(--bg-base);
  font-family: var(--font-sans);
}

.leaflet-control-attribution {
  background: var(--bg-glass) !important;
  color: var(--text-muted) !important;
  backdrop-filter: blur(8px);
}
.leaflet-control-attribution a {
  color: var(--text-secondary) !important;
}

.leaflet-control-zoom {
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.leaflet-control-zoom a {
  background: var(--bg-elevated) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-subtle) !important;
}
.leaflet-control-zoom a:hover {
  background: var(--bg-raised) !important;
}

.robot-marker {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
}
.robot-marker .marker-dot {
  position: absolute;
  inset: 0;
  transition: transform var(--transition-base);
}
.robot-marker .marker-dot svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}
.robot-marker .marker-pulse {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  opacity: 0.4;
  animation: marker-pulse 2s ease-out infinite;
}
.robot-marker.online .marker-dot svg .marker-fill {
  fill: var(--accent-primary);
}
.robot-marker.online .marker-dot svg .marker-stroke {
  stroke: white;
}
.robot-marker.offline .marker-dot svg .marker-fill {
  fill: var(--status-offline);
}
.robot-marker.offline .marker-dot svg .marker-stroke {
  stroke: rgba(255, 255, 255, 0.6);
}
.robot-marker.offline .marker-pulse {
  display: none;
}
.robot-marker.selected .marker-dot {
  transform: scale(1.25);
}
.robot-marker.selected .marker-pulse {
  background: var(--accent-secondary);
  width: 24px;
  height: 24px;
}
.robot-marker .marker-arrow-tip {
  fill: white;
  opacity: 0.95;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}
.robot-marker.offline .marker-arrow-tip {
  opacity: 0.6;
}

@keyframes marker-pulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}
.app-main {
  position: absolute;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
}

.robot-list-panel {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  bottom: var(--space-4);
  width: var(--sidebar-width);
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: var(--bg-overlay);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.robot-list-header {
  padding: var(--space-4) var(--space-5) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}
.robot-list-header h2 {
  margin: 0 0 var(--space-1);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}
.robot-list-header .robot-count {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.robot-list-header .robot-count .count-suffix {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: var(--space-2);
}

.robot-list-search {
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}
.robot-list-search .input {
  padding: 8px 12px;
  font-size: 13px;
}

.robot-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3);
}
.robot-list::-webkit-scrollbar {
  width: 8px;
}
.robot-list::-webkit-scrollbar-track {
  background: transparent;
}
.robot-list::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

.robot-list-empty {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.robot-card {
  width: 100%;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  color: inherit;
  min-width: 0;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.robot-card:hover {
  border-color: var(--accent-primary);
  background: var(--bg-raised);
}
.robot-card.selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary), var(--shadow-md);
}
.robot-card .robot-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.robot-card .robot-status-dot.online {
  background: var(--status-online);
  box-shadow: 0 0 8px var(--status-online);
}
.robot-card .robot-status-dot.offline {
  background: var(--status-offline);
}
.robot-card .robot-info {
  flex: 1;
  min-width: 0;
}
.robot-card .robot-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.robot-card .robot-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: var(--space-2);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.robot-detail-panel {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  bottom: var(--space-4);
  width: 420px;
  max-width: calc(100vw - var(--space-8));
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: var(--bg-overlay);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: panel-slide-in 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes panel-slide-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.robot-detail-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}
.robot-detail-header .header-text {
  flex: 1;
  min-width: 0;
}
.robot-detail-header h2 {
  margin: 0 0 var(--space-1);
  font-size: 18px;
  font-weight: 600;
}
.robot-detail-header .header-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--text-secondary);
}
.robot-detail-header .close-button {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.robot-detail-header .close-button:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.robot-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5);
}
.robot-detail-body::-webkit-scrollbar {
  width: 8px;
}
.robot-detail-body::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

.detail-section {
  margin-bottom: var(--space-5);
}
.detail-section .detail-section-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}

.stat-block {
  padding: var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.stat-block .stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.stat-block .stat-value {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stat-block .stat-unit {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 3px;
  font-weight: 400;
}

.robot-video {
  margin-top: var(--space-3);
}

.robot-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.robot-video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.robot-video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 13px;
  background: radial-gradient(circle at 50% 50%, rgba(45, 212, 191, 0.08) 0%, transparent 60%), #000;
  text-align: center;
  padding: var(--space-4);
}
.robot-video-placeholder .placeholder-icon {
  font-size: 28px;
  margin-bottom: var(--space-2);
  opacity: 0.6;
}

.robot-video-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}

.robot-video-status {
  font-size: 12px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.robot-video-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}
.robot-video-status .status-dot.streaming {
  background: var(--status-online);
  box-shadow: 0 0 6px var(--status-online);
}
.robot-video-status .status-dot.connecting {
  background: var(--status-warn);
  animation: status-pulse 1s ease-in-out infinite;
}
.robot-video-status .status-dot.error {
  background: var(--status-danger);
}

@keyframes status-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}
.camera-selector {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-glass);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 12px;
}

.users-list-actions {
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}
.users-list-actions .btn {
  width: 100%;
  justify-content: center;
}

.users-add-form {
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.users-add-form .users-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}
.users-add-form .users-field .input {
  padding: 8px 12px;
  font-size: 13px;
}
.users-add-form .users-field-cb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  cursor: pointer;
}
.users-add-form .users-add-submit {
  margin-top: var(--space-1);
}
.users-add-form .users-add-submit .btn {
  width: 100%;
  justify-content: center;
}

.users-error {
  margin: var(--space-2) var(--space-3);
}

.user-card {
  margin-bottom: var(--space-2);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast), opacity var(--transition-fast);
}
.user-card:hover {
  border-color: var(--accent-primary);
}
.user-card.expanded {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary), var(--shadow-md);
}
.user-card.busy {
  opacity: 0.55;
}

.user-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: background var(--transition-fast);
}
.user-card-header:hover {
  background: var(--bg-raised);
}
.user-card-header .user-info {
  flex: 1;
  min-width: 0;
}
.user-card-header .user-info .user-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-card-header .user-info .user-email {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.user-card-header .expand-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--transition-base);
}

.user-card.expanded .expand-icon {
  transform: rotate(180deg);
}

.user-card-body {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.user-card-body .users-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}
.user-card-body .users-field .input {
  padding: 8px 12px;
  font-size: 13px;
}
.user-card-body .users-field-cb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  cursor: pointer;
}

.user-card-footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-3);
  margin-top: var(--space-1);
}

.app-root {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-base);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  color: var(--text-primary);
  font-weight: 500;
  transition: all var(--transition-fast);
}
.btn:hover {
  background: var(--bg-elevated);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: var(--text-inverse);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}
.btn.btn-primary:hover:not(:disabled) {
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transform: translateY(-1px);
}
.btn.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}
.btn.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
}
.btn.btn-ghost:hover:not(:disabled) {
  background: var(--bg-glass);
  border-color: var(--accent-primary);
}
.btn.btn-danger {
  background: var(--status-danger);
  color: white;
}
.btn.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}
.input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.input::placeholder {
  color: var(--text-muted);
}

.label {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pill.online {
  background: rgba(52, 211, 153, 0.16);
  color: var(--status-online);
}
.pill.offline {
  background: rgba(100, 116, 139, 0.18);
  color: var(--text-muted);
}

.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid;
  margin-bottom: var(--space-4);
}
.alert.alert-danger {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--status-danger);
}
.alert.alert-info {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--accent-secondary);
}

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

.text-secondary {
  color: var(--text-secondary);
}