@import url('https://cdn.jsdelivr.net/npm/@fontsource-variable/geist@5.1.0/index.min.css');

:root {
  color-scheme: light;

  /* Suite design tokens — aligned with Consult / Migrate */
  --background: 210 40% 98%;
  --foreground: 222 47% 11%;
  --primary: 238 64% 58%;
  --primary-hex: #5156d8;
  --primary-hover: #4449bd;
  --primary-foreground: #ffffff;
  --muted-foreground: 215 16% 47%;
  --border: 214 32% 91%;
  --radius: 0.5rem;

  --bg-dark-sidebar: #071426;
  --bg-dark-sidebar-hover: rgba(255, 255, 255, 0.08);
  --bg-dark-sidebar-active: #4f46e5;
  --bg-dark-sidebar-border: rgba(255, 255, 255, 0.1);

  --accent-primary: #5156d8;
  --accent-primary-hover: #4449bd;
  --accent-orange: var(--accent-primary);
  --accent-orange-hover: var(--accent-primary-hover);
  --accent-blue: var(--accent-primary);
  --accent-blue-hover: var(--accent-primary-hover);
  --accent-blue-light: #eef2ff;

  --bg-page: #f8fafc;
  --bg-panel: #ffffff;
  --bg-panel-alt: #f8fafc;

  --ink-primary: #0f172a;
  --ink-muted: #64748b;
  --ink-light: #f1f5f9;

  --border-color: #e2e8f0;
  --border-light: #e2e8f0;

  --color-online: #22c55e;
  --color-helper: #eab308;
  --color-offline: #94a3b8;

  --font-sans: 'Geist Variable', system-ui, -apple-system, sans-serif;
  --font-mono: 'Consolas', 'Cascadia Mono', monospace;

  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 30px -8px rgba(15, 23, 42, 0.12);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.03);
  --ring-subtle: 1px solid rgba(15, 23, 42, 0.035);
}

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

body {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  background-color: var(--bg-page);
  color: var(--ink-primary);
  min-height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 256px 1fr;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

.connect-console-shell {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background: var(--bg-page);
}

.connect-topbar {
  z-index: 30;
  display: flex;
  height: 3.5rem;
  min-width: 0;
  shrink: 0;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
  padding: 0 16px;
  box-shadow: var(--shadow-sm);
}

.connect-topbar-left {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.connect-topbar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
  letter-spacing: -0.01em;
}

.connect-topbar-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-primary);
}

.connect-topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.connect-live-badge {
  display: inline-flex;
  height: 24px;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: #047857;
}

.connect-topbar-status {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-primary);
}

.connect-workspace-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

body.device-selected .connect-workspace-grid {
  grid-template-columns: 320px minmax(0, 1fr) 400px;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================================================
   PANE 1: LEFT SIDEBAR (Groups & Authentication)
   ========================================================================== */
aside {
  background-color: var(--bg-dark-sidebar);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--bg-dark-sidebar-border);
  overflow-y: auto;
  user-select: none;
}

.brand {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  min-height: 4rem;
}

.brand .mark {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent-primary), #7c3aed);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: white;
}

.suite-switcher {
  display: block;
}

.suite-switcher-trigger {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px;
  text-align: left;
  cursor: pointer;
}

.suite-switcher-trigger:hover,
.suite-switcher-trigger:focus-visible,
.suite-switcher.open .suite-switcher-trigger {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  outline: none;
}

.suite-switcher-chevron {
  margin-left: auto;
  color: #8a9ba8;
  font-size: 15px;
  transition: transform 0.16s ease;
}

.suite-switcher.open .suite-switcher-chevron {
  transform: rotate(180deg);
}

.suite-switcher-menu {
  position: absolute;
  top: calc(100% - 10px);
  left: 14px;
  right: 14px;
  z-index: 50;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: #101b2a;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  padding: 8px;
}

.suite-switcher-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #dbeafe;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  text-align: left;
}

.suite-switcher-item:hover,
.suite-switcher-item:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.suite-switcher-item.current {
  background: rgba(81, 86, 216, 0.22);
  color: #eef2ff;
}

.suite-switcher-logo-tile {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.suite-switcher-logo-tile img {
  width: 26px;
  height: 26px;
  display: block;
  object-fit: contain;
}

.suite-switcher-item strong,
.suite-switcher-item small {
  display: block;
}

.suite-switcher-item strong {
  font-size: 12px;
  font-weight: 700;
}

.suite-switcher-item small {
  color: #94a3b8;
  font-size: 10px;
  line-height: 1.3;
  margin-top: 2px;
}

.brand-text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.brand-text small {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #c7d2fe;
}

.suite-launch-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #030712;
}

.suite-launch-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(79, 70, 229, 0.28), transparent 42%);
  pointer-events: none;
}

.suite-launch-overlay[hidden] {
  display: none !important;
}

.suite-launch-card {
  position: relative;
  width: min(100%, 32rem);
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(165, 180, 252, 0.25);
  background: linear-gradient(180deg, #122445 0%, #0b1830 52%, #071426 100%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
  color: #e2e8f0;
}

.suite-launch-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.suite-launch-lock {
  display: flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #4f46e5;
  box-shadow: 0 10px 24px rgba(49, 46, 129, 0.45);
  font-size: 18px;
}

.suite-launch-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #c7d2fe;
}

.suite-launch-subkicker {
  font-size: 14px;
  font-weight: 500;
  color: #e2e8f0;
}

.suite-launch-spinner {
  width: 20px;
  height: 20px;
  margin-left: auto;
  border: 2px solid rgba(165, 180, 252, 0.25);
  border-top-color: #a5b4fc;
  border-radius: 999px;
  animation: suiteLaunchSpin 0.9s linear infinite;
}

.suite-launch-body {
  padding: 32px 24px;
  text-align: center;
}

.suite-launch-ring-wrap {
  position: relative;
  width: 128px;
  height: 128px;
  margin: 0 auto 24px;
}

.suite-launch-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 3px solid rgba(129, 140, 248, 0.25);
  border-top-color: #a5b4fc;
  animation: suiteLaunchSpin 1.4s linear infinite;
}

.suite-launch-logo-tile {
  position: absolute;
  inset: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #ffffff;
  color: #312e81;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.35);
}

.suite-launch-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(165, 180, 252, 0.35);
  background: rgba(79, 70, 229, 0.25);
  color: #eef2ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.suite-launch-title {
  font-size: 1.875rem;
  font-weight: 600;
  color: #ffffff;
}

.suite-launch-copy {
  margin: 12px auto 0;
  max-width: 22rem;
  color: #cbd5e1;
  font-size: 15px;
  line-height: 1.7;
}

.suite-launch-steps {
  margin-top: 28px;
  display: grid;
  gap: 12px;
  text-align: left;
}

.suite-launch-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0f1c33;
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.35s ease;
}

.suite-launch-step span {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #334155;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 700;
}

.suite-launch-step.is-active {
  border-color: rgba(165, 180, 252, 0.5);
  background: rgba(79, 70, 229, 0.2);
  color: #ffffff;
}

.suite-launch-step.is-active span {
  background: #818cf8;
}

.suite-launch-step.is-complete {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(16, 185, 129, 0.12);
}

.suite-launch-step.is-complete span {
  background: #10b981;
}

.suite-launch-progress {
  margin-top: 24px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #1e293b;
}

.suite-launch-progress-bar {
  width: 33%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #818cf8, #38bdf8, #6366f1);
  animation: suiteLaunchProgress 1.4s ease-in-out infinite;
}

@keyframes suiteLaunchSpin {
  to { transform: rotate(360deg); }
}

@keyframes suiteLaunchProgress {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.suite-context {
  margin: 14px 14px 0;
  padding: 12px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.44);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.suite-context-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: #dbeafe;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.suite-context-header button {
  border: 1px solid rgba(147, 197, 253, 0.32);
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.18);
  color: #bfdbfe;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
}

.suite-context-header button:hover {
  background: rgba(37, 99, 235, 0.3);
}

.suite-context-lines {
  display: grid;
  gap: 6px;
}

.suite-context-line {
  display: grid;
  gap: 2px;
}

.suite-context-line span {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.suite-context-line strong {
  overflow: hidden;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Navigation Groups */
.sidebar-scroll {
  flex: 1;
  padding: 16px 8px;
}

.group-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.18em;
  padding: 8px 12px;
  margin-top: 12px;
}

.group-title:first-child {
  margin-top: 0;
}

.group-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  cursor: pointer;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.12s ease, color 0.12s ease;
}

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

.group-item.active {
  background-color: var(--bg-dark-sidebar-active);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.group-item .item-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-item .item-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.group-item.active .item-icon {
  opacity: 1;
  color: #ffffff;
}

.group-item .badge {
  font-size: 10px;
  background-color: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 10px;
  color: #94a3b8;
}

.group-item.active .badge {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Companies Sub-list */
.company-sublist {
  padding-left: 20px;
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.company-sublist .group-item {
  font-size: 12px;
  padding: 6px 10px;
}

/* Bottom Sidebar Panel (Auth and Stats) */
.sidebar-footer {
  border-top: 1px solid var(--bg-dark-sidebar-border);
  padding: 12px;
  background-color: rgba(0, 0, 0, 0.15);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-title {
  font-size: 10px;
  font-weight: 700;
  color: #5c7080;
  text-transform: uppercase;
}

.auth-input-group {
  display: flex;
  gap: 4px;
}

.auth-input-group input {
  flex: 1;
  background-color: #1a2736;
  border: 1px solid #2b3a4a;
  color: white;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
}

.auth-input-group input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(81, 86, 216, 0.2);
}

.auth-input-group button {
  background-color: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.auth-input-group button:hover {
  background-color: var(--accent-primary-hover);
}

/* ==========================================================================
   PANE 2: MIDDLE PANEL (Sessions / Devices List)
   ========================================================================== */
.sessions-pane {
  background-color: #ffffff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sessions-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.sessions-title-row h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-primary);
  letter-spacing: -0.01em;
}

.action-buttons-group {
  display: flex;
  gap: 6px;
}

.btn-small {
  background: white;
  border: 1px solid var(--border-color);
  color: var(--ink-primary);
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-small:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.btn-primary-small {
  background-color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  color: white;
  box-shadow: 0 1px 2px rgba(81, 86, 216, 0.2);
}

.btn-primary-small:hover {
  background-color: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
  color: white;
}

.search-container {
  position: relative;
}

.search-container input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  background: #ffffff;
}

.search-container input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(81, 86, 216, 0.15);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--ink-muted);
  pointer-events: none;
}

/* Agents Cards List */
.agents-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.agent-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: start;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
  user-select: none;
  box-shadow: var(--shadow-card);
  position: relative;
}

.agent-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.agent-card.active {
  border-color: rgba(81, 86, 216, 0.45);
  background-color: #eef2ff;
  box-shadow: 0 0 0 1px rgba(81, 86, 216, 0.12);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.status-dot.online {
  background-color: var(--color-online);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
  animation: pulse-green 2s infinite;
}

.status-dot.pending {
  background-color: var(--color-helper);
  box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.2);
}

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

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  70% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.agent-details {
  flex: 1;
  min-width: 0;
}

.agent-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.agent-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-card-tags {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.badge-tag {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  background-color: var(--border-light);
  color: var(--ink-muted);
}

.badge-tag.blue {
  background-color: var(--accent-blue-light);
  color: var(--accent-primary);
}

/* Empty agents placeholder */
.agents-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-muted);
}

.agents-empty svg {
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ==========================================================================
   PANE 3: RIGHT PANEL (Device Details & Workspace)
   ========================================================================== */
main {
  background-color: var(--bg-page);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Welcome Page (If nothing selected) */
.welcome-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 24px 32px 40px;
  text-align: left;
  max-width: 820px;
  margin: 0;
  width: 100%;
}

.welcome-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.welcome-logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.welcome-logo img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.welcome-screen h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--ink-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.welcome-screen p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-muted);
  margin-bottom: 28px;
  max-width: 560px;
}

.welcome-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  margin-bottom: 32px;
}

.welcome-stat-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
}

.welcome-stat-card span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}

.welcome-stat-card strong {
  font-size: 24px;
  font-weight: 600;
  color: var(--ink-primary);
  font-variant-numeric: tabular-nums;
}

.welcome-actions {
  display: flex;
  gap: 12px;
}

/* Active Device Screen */
.workspace-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header Area */
.workspace-header {
  background-color: var(--bg-panel);
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
}

.device-info h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-primary);
  letter-spacing: -0.3px;
}

.device-info p {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background-color: var(--border-light);
  color: var(--ink-muted);
}

.connection-pill.connected {
  background-color: #dcfce7;
  color: #166534;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-join {
  background-color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  color: white;
  height: 36px;
  padding: 0 14px;
  font-weight: 600;
  font-size: 13px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.12s ease;
  box-shadow: 0 1px 2px rgba(81, 86, 216, 0.25);
}

.btn-join:hover:not(:disabled) {
  background-color: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
}

.btn-join:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background-color: white;
  border: 1px solid var(--border-color);
  color: var(--ink-primary);
  height: 38px;
  padding: 0 14px;
  font-weight: 500;
  font-size: 13px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover:not(:disabled) {
  border-color: #cbd5e1;
  color: var(--ink-primary);
  background-color: var(--bg-panel-alt);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Tabs Navigation — Migrate client workspace pattern */
.workspace-tabs {
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  padding: 10px 24px;
  gap: 6px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--ink-muted);
  font-weight: 500;
  font-size: 13px;
  min-height: 36px;
  padding: 0 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--ink-primary);
  background: #f1f5f9;
}

.tab-btn.active {
  color: #ffffff;
  background: var(--accent-primary);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(81, 86, 216, 0.2);
}

/* Content Area */
.workspace-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.tab-pane {
  display: none;
  height: 100%;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   TAB 1: REMOTE SCREEN VIEW
   ========================================================================== */
.screen-tab-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  height: 100%;
  align-items: start;
}

.screen-viewport-card {
  background-color: #1e293b;
  border: 1px solid #0f172a;
  border-radius: 8px;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.screen-viewport-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: crosshair;
  display: none;
}

.screen-viewport-card.has-image img {
  display: block;
}

.screen-viewport-card.has-image .screen-placeholder {
  display: none;
}

.screen-placeholder {
  color: #94a3b8;
  text-align: center;
  font-size: 14px;
}

.screen-placeholder svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
  color: white;
}

.input-controls-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-controls-card h3 {
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.input-group-row {
  display: flex;
  gap: 6px;
}

.input-group-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 12px;
}

.input-group-row input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(81, 86, 216, 0.12);
}

.btn-action {
  background-color: var(--accent-primary);
  color: white;
  border: 1px solid var(--accent-primary);
  padding: 0 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
}

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

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

.btn-key {
  background-color: var(--bg-panel-alt);
  border: 1px solid var(--border-color);
  padding: 8px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.1s ease;
}

.btn-key:hover {
  background-color: #f1f5f9;
  border-color: #94a3b8;
}

.status-text-banner {
  font-size: 12px;
  padding: 8px 12px;
  background-color: var(--bg-panel-alt);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--ink-muted);
}

.metrics-panel {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background-color: var(--bg-panel);
  overflow: hidden;
}

.metrics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  background-color: var(--bg-panel-alt);
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.metrics-header small {
  min-width: 0;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metrics-grid {
  display: grid;
  grid-template-columns: minmax(86px, 0.9fr) minmax(96px, 1.1fr);
  gap: 1px;
  background-color: var(--border-light);
  font-size: 11px;
}

.metrics-grid span,
.metrics-grid strong {
  min-width: 0;
  padding: 7px 9px;
  background-color: #fff;
}

.metrics-grid span {
  color: var(--ink-muted);
  font-weight: 600;
}

.metrics-grid strong {
  color: var(--ink);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   TAB 2: FILE EXPLORER
   ========================================================================== */
.files-tab-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  height: 100%;
}

.path-toolbar {
  display: flex;
  gap: 8px;
}

.path-toolbar input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.path-toolbar input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.explorer-grid {
  flex: 1;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow-y: auto;
  min-height: 250px;
}

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

.explorer-table th {
  background-color: var(--bg-panel-alt);
  padding: 8px 12px;
  font-weight: 600;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--border-light);
  font-size: 11px;
  text-transform: uppercase;
}

.explorer-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.explorer-table tr:hover td {
  background-color: #f8fafc;
}

.item-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.icon-folder { color: #f59e0b; }
.icon-file { color: #64748b; }

.btn-link-action {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-weight: 600;
  cursor: pointer;
}

.btn-link-action:hover {
  text-decoration: underline;
  color: var(--accent-blue-hover);
}

/* ==========================================================================
   TAB 3: POWERSHELL / BACKSTAGE TERMINAL
   ========================================================================== */
.backstage-tab-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.terminal-card {
  flex: 1;
  background-color: #0b0f19;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.terminal-output {
  flex: 1;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a7f3d0; /* light emerald green */
  white-space: pre-wrap;
  margin-bottom: 12px;
  line-height: 1.6;
}

.terminal-input-row {
  display: flex;
  gap: 8px;
  border-top: 1px solid #1e293b;
  padding-top: 12px;
}

.terminal-input-row textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  font-family: var(--font-mono);
  font-size: 13px;
  resize: none;
  height: 36px;
}

.terminal-input-row textarea:focus {
  outline: none;
}

.terminal-input-row button {
  background-color: var(--accent-blue);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0 16px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.terminal-input-row button:hover {
  background-color: var(--accent-blue-hover);
}

/* ==========================================================================
   TAB 4: SYSTEM INFO
   ========================================================================== */
.info-tab-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.info-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
}

.info-card h3 {
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
  margin-bottom: 12px;
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  row-gap: 8px;
  font-size: 12px;
}

.info-label {
  color: var(--ink-muted);
  font-weight: 500;
}

.info-value {
  color: var(--ink-primary);
  font-weight: 600;
  word-break: break-all;
}

/* ==========================================================================
   INSTALLER BUILDER MODAL
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--bg-panel);
  border-radius: 16px;
  border: 1px solid var(--border-light);
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-overlay.show .modal-content {
  transform: translateY(0);
}

.modal-header {
  background-color: var(--bg-panel-alt);
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-primary);
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--ink-muted);
  transition: color 0.15s ease;
}

.btn-close-modal:hover {
  color: var(--ink-primary);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

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

.form-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-field input {
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 12px;
}

.form-field input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(81, 86, 216, 0.12);
}

.form-field.checkbox-field {
  flex-direction: row;
  align-items: center;
  height: 100%;
  padding-top: 18px;
}

.form-field.checkbox-field input {
  width: auto;
  margin-right: 8px;
}

.command-preview-box {
  background-color: #0b0f19;
  border-radius: 6px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid #1e293b;
  min-height: 60px;
  max-height: 120px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background-color: var(--bg-panel-alt);
}

/* ==========================================================================
   PANE 4: DEVICE INSPECTOR (ScreenConnect-style)
   ========================================================================== */
.device-inspector-pane {
  background: var(--bg-panel);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-panel-alt);
}

.inspector-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 8px;
}

.btn-icon-close {
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 0 4px;
}

.btn-icon-close:hover {
  color: var(--ink-primary);
}

.inspector-preview-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.inspector-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.inspector-preview-frame {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #0f172a;
  cursor: zoom-in;
  overflow: hidden;
  min-height: 140px;
  position: relative;
}

.inspector-preview-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
}

.inspector-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}

.inspector-details-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sc-detail-row {
  display: grid;
  grid-template-columns: 42% 58%;
  gap: 8px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--border-light);
  align-items: start;
  font-size: 12px;
}

.sc-detail-row.editable {
  align-items: center;
}

.sc-detail-label {
  color: var(--ink-muted);
  font-weight: 500;
}

.sc-detail-value {
  color: var(--ink-primary);
  word-break: break-word;
}

.sc-detail-input {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 12px;
  background: white;
}

.sc-detail-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(81, 86, 216, 0.12);
}

.inspector-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-panel-alt);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.92);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox-overlay.show {
  display: flex;
}

.lightbox-overlay img {
  max-width: 96vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  background: transparent;
  border: none;
  color: white;
  font-size: 36px;
  cursor: pointer;
  line-height: 1;
}

/* Status indicator colors */
#status.status-connecting { color: var(--accent-primary); }
#status.status-connected { color: #047857; }
#status.status-error { color: #dc2626; }

/* Responsive Overrides */
@media (max-width: 1024px) {
  body {
    grid-template-columns: 200px 1fr;
  }
  .connect-workspace-grid {
    grid-template-columns: 260px 1fr;
  }
  body.device-selected .connect-workspace-grid {
    grid-template-columns: 240px minmax(0, 1fr) 320px;
  }
}

@media (max-width: 768px) {
  body {
    grid-template-columns: 1fr;
  }
  aside,
  .sessions-pane {
    display: none;
  }
  .connect-workspace-grid {
    grid-template-columns: 1fr;
  }
  body.device-selected .connect-workspace-grid {
    grid-template-columns: 1fr;
  }
}
