/* ==========================================================================
   56KLabz L.A. Noir Design System v3.0 - 56K-GSM Cloud Control Plane
   Color Palette:
     --bg-deep:      #05060A (Obsidian primary)
     --bg-surface:   #0B0E17 (Darkened slate card background)
     --bg-surface-2: #121624 (Secondary elevated surface)
     --bg-surface-3: #181E30 (Hover / input active surface)
     --border-subtle:#232B40 (Brass/steel muted boundary)
     --border-focus: #E8A020 (Signature 56K Warm Amber)
     --amber-core:   #E8A020 (Primary accent)
     --amber-glow:   rgba(232, 160, 32, 0.22)
     --amber-light:  #FFB834
     --text-parchment:#E8DDC8 (Primary crisp typography)
     --text-muted:   #8C96A8
     --text-dim:     #525D73
     --status-online:#10B981
     --status-busy:  #F59E0B
     --status-error: #EF4444
   ========================================================================== */

:root {
  --bg-deep: #05060A;
  --bg-surface: #0B0E17;
  --bg-surface-2: #121624;
  --bg-surface-3: #181E30;
  --border-subtle: #232B40;
  --border-highlight: #34405E;
  --amber-core: #E8A020;
  --amber-glow: rgba(232, 160, 32, 0.25);
  --amber-light: #FFB834;
  --text-parchment: #E8DDC8;
  --text-muted: #8C96A8;
  --text-dim: #525D73;
  --status-online: #10B981;
  --status-online-glow: rgba(16, 185, 129, 0.3);
  --status-busy: #F59E0B;
  --status-busy-glow: rgba(245, 158, 11, 0.3);
  --status-error: #EF4444;
  --status-error-glow: rgba(239, 68, 68, 0.3);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Courier New', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

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

body {
  background-color: var(--bg-deep);
  color: var(--text-parchment);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Subtle background vignette & tactical grid overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(232, 160, 32, 0.05) 0%, transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--amber-core);
}

/* Layout Container */
.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

#login-view {
  min-height: 100vh;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#app-view:not(.authenticated) {
  display: none !important;
}

/* Top Navigation Bar */
.top-nav {
  position: sticky;
  top: 0;
  background: rgba(11, 14, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 40;
  gap: 16px;
}

.top-nav-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-right-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px var(--amber-glow));
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  background: rgba(232, 160, 32, 0.15);
  color: var(--amber-light);
  border: 1px solid rgba(232, 160, 32, 0.35);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Telemetry Pills */
.telemetry-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.telemetry-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 12px;
}

.telemetry-label {
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 600;
}

.telemetry-val {
  color: var(--text-parchment);
  font-weight: 600;
}

.telemetry-val.highlight {
  color: var(--amber-light);
}

/* User & Action Buttons */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  outline: none;
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--amber-core), #C88210);
  color: #05060A;
  border-color: #FFAE2B;
  box-shadow: 0 2px 12px var(--amber-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #FFB02E, #D98C15);
  box-shadow: 0 4px 16px rgba(232, 160, 32, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-2);
  color: var(--text-parchment);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-surface-3);
  border-color: var(--border-highlight);
  color: #FFFFFF;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.6);
  color: #FFFFFF;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-md);
}

/* Main Content Area */
.main-view {
  flex: 1;
  padding: 24px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

/* Cloud Matrix / High-Density Telemetry Strip */
.cloud-stats-strip,
.host-stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.stat-card:hover {
  border-color: var(--border-highlight);
}

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

.stat-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-icon {
  width: 18px;
  height: 18px;
  color: var(--amber-core);
  opacity: 0.8;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #FFFFFF;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Progress bar inside stat card */
.stat-progress {
  height: 4px;
  background: var(--bg-surface-3);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.stat-progress-bar {
  height: 100%;
  background: var(--amber-core);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* Toolbar & Filter Bar */
.toolbar-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.search-input-wrapper {
  position: relative;
  min-width: 280px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
}

.form-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 9px 14px 9px 36px;
  font-size: 13px;
  color: var(--text-parchment);
  font-family: var(--font-sans);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--amber-core);
  box-shadow: 0 0 0 3px var(--amber-glow);
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn.active, .filter-btn:hover {
  background: var(--bg-surface-2);
  border-color: var(--amber-core);
  color: var(--amber-light);
}

/* Server Cards Grid */
.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.server-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s, box-shadow 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
}

.server-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.server-card.running {
  border-top: 3px solid var(--status-online);
}

.server-card.stopped {
  border-top: 3px solid var(--text-dim);
}

.server-card.starting {
  border-top: 3px solid var(--status-busy);
}

.server-card-header {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.server-game-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--bg-surface-3);
  border: 1px solid var(--border-subtle);
}

.server-info-title {
  flex: 1;
  min-width: 0;
}

.server-name {
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-game-type {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.server-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

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

.status-online {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.status-online .status-dot {
  background: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-stopped {
  background: rgba(140, 150, 168, 0.1);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}
.status-stopped .status-dot {
  background: var(--text-dim);
}

.status-busy {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.status-busy .status-dot {
  background: #F59E0B;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

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

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

.meta-item {
  background: var(--bg-surface-2);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.meta-item-label {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-dim);
  display: block;
}

.meta-item-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-parchment);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 2px;
}

.server-card-footer {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-window {
  background: var(--bg-surface);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-window.large {
  max-width: 960px;
}

.modal-overlay.active .modal-window {
  transform: scale(1);
}

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover {
  color: #FFFFFF;
}

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

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

/* Console Terminal Window */
.terminal-container {
  background: #000000;
  border: 1px solid #1A2133;
  border-radius: var(--radius-md);
  height: 440px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.terminal-header {
  background: #0B0E17;
  padding: 8px 14px;
  border-bottom: 1px solid #1A2133;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.terminal-body {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: #D1D5DB;
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-input-bar {
  display: flex;
  align-items: center;
  background: #0B0E17;
  border-top: 1px solid #1A2133;
  padding: 8px 12px;
  gap: 8px;
}

.terminal-prompt {
  color: var(--amber-core);
  font-family: var(--font-mono);
  font-weight: 700;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 13px;
  color: #FFFFFF;
}

/* Deploy Wizard Steps */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.wizard-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

.wizard-step.active {
  background: rgba(232, 160, 32, 0.12);
  border-color: var(--amber-core);
  color: var(--amber-light);
}

.wizard-step.done {
  border-color: var(--status-online);
  color: var(--status-online);
}

.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--font-mono);
  font-size: 10px;
}

.wizard-step.active .step-num {
  background: var(--amber-core);
  color: #000;
}

.games-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding: 2px;
}

.game-select-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.game-select-card:hover {
  border-color: var(--border-highlight);
  background: var(--bg-surface-3);
}

.game-select-card.selected {
  border-color: var(--amber-core);
  background: rgba(232, 160, 32, 0.12);
  box-shadow: 0 0 12px var(--amber-glow);
}

.game-select-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--bg-deep);
}

.game-select-name {
  font-size: 12px;
  font-weight: 600;
  color: #FFFFFF;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Auth Portal */
.login-box {
  max-width: 400px;
  margin: 100px auto 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
}

.login-logo {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 16px var(--amber-glow));
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Notifications / Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  min-width: 280px;
  font-size: 13px;
  animation: slide-up 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success {
  border-left: 4px solid var(--status-online);
}

.toast.error {
  border-left: 4px solid var(--status-error);
}

@keyframes slide-up {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Source Badges */
.badge-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
  letter-spacing: 0.04em;
}

.badge-source.steam {
  background: rgba(56, 189, 248, 0.12);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.badge-source.direct {
  background: rgba(232, 160, 32, 0.15);
  color: var(--amber-light);
  border: 1px solid rgba(232, 160, 32, 0.4);
}

/* Callout Banner */
.callout-banner {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--amber-core);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.callout-text {
  font-size: 12px;
  color: var(--text-parchment);
}

.callout-text strong {
  color: #FFFFFF;
}

/* Directory Browser & Launcher Pills */
.fs-browser-container {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 14px;
}

.fs-browser-header {
  padding: 8px 12px;
  background: var(--bg-surface-3);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.fs-dir-list {
  max-height: 160px;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fs-dir-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-parchment);
  transition: background 0.15s;
}

.fs-dir-item:hover {
  background: var(--bg-surface-3);
  color: #FFFFFF;
}

.launcher-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  min-height: 28px;
}

.launcher-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 14px;
  background: rgba(232, 160, 32, 0.1);
  border: 1px solid rgba(232, 160, 32, 0.3);
  color: var(--amber-light);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.launcher-chip:hover, .launcher-chip.active {
  background: var(--amber-core);
  color: #05060A;
  border-color: #FFAE2B;
  font-weight: 700;
}

/* 56KLabz Account User Profile Navigation Component */
.user-account-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px 10px;
  transition: all 0.2s ease;
}

.user-account-badge:hover {
  border-color: rgba(232, 160, 32, 0.4);
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(232, 160, 32, 0.15);
  border: 1px solid var(--amber-core);
  color: var(--amber-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.user-meta-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-meta-email {
  font-size: 12px;
  font-weight: 600;
  color: #FFFFFF;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-family: var(--font-mono);
}

.badge-cloud-tier {
  color: var(--amber-light);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-slots-quota {
  color: var(--status-online);
  font-weight: 600;
}

.user-account-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.2s;
}

.user-account-link:hover {
  color: #FFFFFF;
  background: rgba(232, 160, 32, 0.2);
}

/* ==========================================================================
   Responsive Grid Utilities
   ========================================================================== */
.modal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.modal-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

/* ==========================================================================
   Mobile & Tablet Responsive Adaptations (L.A. Noir Clean UX)
   ========================================================================== */

/* ==========================================================================
   Mobile & Tablet Responsive Adaptations (L.A. Noir Clean UX)
   ========================================================================== */

/* Prevent horizontal page drift / side swiping */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
  touch-action: pan-y pinch-zoom;
  overscroll-behavior-x: none;
}

.app-container {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Tablets & Small Laptops (max-width: 900px) */
@media screen and (max-width: 900px) {
  .top-nav {
    height: auto;
    padding: 10px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
  }

  .telemetry-bar {
    order: 3;
    width: 100%;
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }

  .telemetry-badge {
    flex: 1;
    justify-content: center;
    padding: 4px 8px;
    font-size: 11px;
  }

  .main-view {
    padding: 16px;
  }

  .cloud-stats-strip,
  .host-stats-strip {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
  }

  .team-invite-bar {
    grid-template-columns: 1fr;
  }

  .team-split-grid {
    grid-template-columns: 1fr;
  }

  .modal-window.large {
    max-width: 95vw;
  }
}

/* Mobile Phones (max-width: 640px) */
@media screen and (max-width: 640px) {
  /* Navigation: Clean, uncluttered 2-tier row system */
  .top-nav {
    height: auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  /* Row 1: Brand Logo on Left, User Badge + Actions on Right */
  .top-nav-main {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .nav-right-group {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .brand-section {
    gap: 8px;
  }

  .brand-logo {
    width: 28px;
    height: 28px;
  }

  .brand-title {
    font-size: 14px;
    gap: 6px;
  }

  .brand-badge {
    font-size: 9px;
    padding: 1px 4px;
  }

  .brand-subtitle {
    display: none; /* Hide lengthy slogan on phones */
  }

  /* User Account Badge */
  .user-account-badge {
    padding: 2px 6px;
    gap: 6px;
    border-radius: var(--radius-sm);
  }

  .user-avatar-circle {
    width: 22px;
    height: 22px;
    font-size: 9px;
  }

  .user-meta-email {
    display: none; /* Keep email hidden on mobile so it doesn't crush buttons */
  }

  .user-meta-badges {
    gap: 4px;
    font-size: 9px;
  }

  .badge-cloud-tier {
    font-size: 9px;
  }

  .badge-slots-quota {
    font-size: 9px;
  }

  .user-account-link {
    display: none; /* Reached via badge tap */
  }

  /* Navigation Buttons */
  .nav-actions {
    gap: 6px;
  }

  .nav-actions .btn {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: var(--radius-sm);
  }

  /* Hide long button text on ultra small screens; keep icons crisp */
  .nav-actions .btn-label {
    font-size: 11px;
  }

  /* Telemetry Bar: Compact Bottom Row */
  .telemetry-bar {
    order: 3;
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }

  .telemetry-badge {
    flex: 1;
    padding: 3px 6px;
    font-size: 10px;
    border-radius: var(--radius-sm);
    justify-content: center;
    gap: 4px;
  }

  .telemetry-label {
    font-size: 8px;
  }

  .telemetry-val {
    font-size: 10px;
  }

  /* Main Workspace */
  .main-view {
    padding: 12px 10px 24px;
    max-width: 100vw;
    box-sizing: border-box;
  }

  /* High-Density Stat Cards */
  .cloud-stats-strip,
  .host-stats-strip {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 14px;
  }

  .stat-card {
    padding: 12px 14px;
  }

  .stat-value {
    font-size: 20px;
  }

  /* Toolbar & Filter Bar */
  .toolbar-section {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 14px;
  }

  .search-input-wrapper {
    min-width: 100%;
    width: 100%;
  }

  .filter-pills {
    width: 100%;
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .filter-btn {
    flex: 1;
    text-align: center;
    white-space: nowrap;
    padding: 6px 8px;
    font-size: 11px;
  }

  /* Dedicated Server Cards */
  .servers-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .server-card-header {
    padding: 12px;
    gap: 10px;
  }

  .server-game-thumb {
    width: 38px;
    height: 38px;
  }

  .server-name {
    font-size: 13px;
  }

  .server-status-pill {
    padding: 3px 7px;
    font-size: 9px;
  }

  .server-card-body {
    padding: 10px 12px;
    gap: 8px;
  }

  .meta-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .meta-item {
    padding: 5px 8px;
  }

  .meta-item-label {
    font-size: 9px;
  }

  .meta-item-val {
    font-size: 11px;
  }

  .server-card-footer {
    padding: 8px 12px;
  }

  .server-card-footer .btn {
    min-width: 36px;
    min-height: 36px;
    padding: 8px;
  }

  /* Modals */
  .modal-overlay {
    padding: 0;
    align-items: flex-end; /* Slide up bottom sheet on mobile */
  }

  .modal-window,
  .modal-window.large {
    max-width: 100vw;
    max-height: 94vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  .modal-header {
    padding: 12px 16px;
  }

  .modal-title {
    font-size: 14px;
  }

  .modal-body {
    padding: 14px 16px;
  }

  .modal-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .modal-footer .btn {
    flex: 1;
    min-width: 100px;
    padding: 8px 12px;
  }

  /* Modal form grids */
  .modal-grid-2,
  .modal-grid-3 {
    grid-template-columns: 1fr !important;
  }

  /* Wizard Steps */
  .wizard-steps {
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
  }

  .wizard-step {
    padding: 6px 10px;
    width: 100%;
  }

  .games-select-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    max-height: 250px;
  }

  .game-select-card {
    padding: 6px;
  }

  .game-select-thumb {
    width: 42px;
    height: 42px;
  }

  .game-select-name {
    font-size: 10px;
  }

  /* Terminal in Console Modal */
  .terminal-container {
    height: 280px;
  }

  .terminal-body {
    font-size: 11px;
    padding: 8px;
  }

  /* Login Card */
  .login-box {
    margin: 30px auto 16px;
    padding: 20px 16px;
    max-width: 94vw;
  }

  .login-logo {
    width: 44px;
    height: 44px;
  }

  .login-title {
    font-size: 18px;
  }

  /* Toasts */
  .toast-container {
    bottom: 12px;
    right: 12px;
    left: 12px;
  }

  .toast {
    min-width: 0;
    width: 100%;
  }
}

/* ==========================================================================
   CONCEPT 4: LINEAR / VERCEL ULTRA-MINIMAL DARK SYSTEM
   ========================================================================== */

:root {
  --bg-deep: #090a0f;
  --bg-surface: #0c0e14;
  --bg-surface-2: #11141d;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-divider: rgba(255, 255, 255, 0.06);
  --text-parchment: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

body {
  background-color: #090a0f;
  color: #f8fafc;
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
}

body::before {
  display: none;
}

.linear-shell {
  max-width: 1024px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 24px 72px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Minimal Header */
.linear-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 14, 23, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 16px;
  padding: 14px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.linear-logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #ffffff;
  color: #000000;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.linear-breadcrumb {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.linear-slash {
  color: #475569;
  margin: 0 4px;
  font-weight: 400;
}

.linear-header-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.linear-header-search-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f8fafc;
}

.linear-header-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #64748b;
}

.linear-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.linear-actions-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.linear-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px 10px 4px 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.linear-profile-pill:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.linear-profile-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.linear-profile-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.2;
}

.linear-profile-email {
  font-size: 11px;
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap;
}

.linear-profile-tier {
  font-size: 10px;
  font-family: var(--font-mono);
  color: #10b981;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.linear-tier-text {
  color: #10b981;
  font-weight: 600;
}

.linear-actions-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Linear Buttons */
.linear-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 6px;
  background: #ffffff;
  color: #090a0f;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #ffffff;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.linear-btn-primary:hover {
  background: #e2e8f0;
  border-color: #e2e8f0;
}

.linear-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  background: transparent;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.linear-btn-ghost:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.18);
}

.linear-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.15s ease;
}

.linear-btn-icon:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

/* Minimal Notice Banner */
.linear-notice-banner {
  background: #0c0e14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #94a3b8;
}

.linear-notice-text {
  display: flex;
  align-items: center;
  gap: 10px;
}

.linear-notice-text strong {
  color: #f8fafc;
}

.linear-notice-link {
  color: #ffffff;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.linear-notice-link:hover {
  text-decoration: underline;
}

/* Minimal Filter & Search Subbar */
.linear-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.linear-subbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.linear-filter-group {
  display: inline-flex;
  background: #0c0e14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.linear-filter-group .filter-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.linear-filter-group .filter-btn:hover {
  color: #cbd5e1;
}

.linear-filter-group .filter-btn.active {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.linear-count-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #64748b;
}

.linear-search-wrap {
  position: relative;
  width: 240px;
}

.linear-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  color: #475569;
  pointer-events: none;
}

.linear-search-input {
  width: 100%;
  background: #0c0e14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  padding: 6px 12px 6px 30px;
  font-size: 12px;
  color: #f8fafc;
  outline: none;
  transition: border-color 0.15s ease;
}

.linear-search-input::placeholder {
  color: #475569;
}

.linear-search-input:focus {
  border-color: rgba(255, 255, 255, 0.24);
}

/* Divided Minimalist Server List Container */
.linear-list {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: #0c0e14;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.linear-row {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.12s ease;
}

.linear-row:last-child {
  border-bottom: none;
}

.linear-row:hover {
  background: rgba(255, 255, 255, 0.015);
}

.linear-row-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

/* Status Dots */
.linear-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #475569;
}

.linear-status-dot.online {
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}

.linear-status-dot.starting {
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
}

.linear-status-dot.stopped {
  background: #475569;
}

.linear-row-info {
  min-width: 0;
}

.linear-row-title {
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.linear-row-title.stopped-title {
  color: #cbd5e1;
}

.linear-game-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #64748b;
  font-weight: 400;
}

.linear-row-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.linear-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Row Action Buttons matching Concept 4 */
.linear-act-btn {
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s ease;
}

.linear-act-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.linear-act-btn.amber {
  color: #fbbf24;
}

.linear-act-btn.amber:hover {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
}

.linear-act-btn.red {
  color: #f87171;
}

.linear-act-btn.red:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.3);
}

.linear-act-btn.start {
  padding: 5px 13px;
  background: #10b981;
  border-color: #10b981;
  color: #000000;
  font-weight: 600;
}

.linear-act-btn.start:hover {
  background: #34d399;
  border-color: #34d399;
  color: #000000;
}

.linear-act-btn.cockpit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(232, 160, 32, 0.12);
  border: 1px solid rgba(232, 160, 32, 0.4);
  color: #fbbf24;
  font-weight: 600;
  border-radius: 6px;
}

.linear-act-btn.cockpit-btn:hover {
  background: rgba(232, 160, 32, 0.22);
  border-color: #e8a020;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(232, 160, 32, 0.35);
}

/* ==========================================================================
   Tactical Command Cockpit HUD
   ========================================================================== */

.modal-window.cockpit-window {
  max-width: 1200px;
  width: 95vw;
  height: 90vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #090c13;
  border: 1px solid rgba(232, 160, 32, 0.28);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.9);
}

.cockpit-top-bar {
  padding: 14px 20px;
  background: #07090e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cockpit-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cockpit-title-text {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

.cockpit-sub-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.cockpit-tabs-bar {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  background: #0a0d14;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
}

.cockpit-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cockpit-tab-btn:hover {
  color: #ffffff;
}

.cockpit-tab-btn.active {
  color: var(--amber-light);
  border-bottom-color: var(--amber-core);
  background: rgba(232, 160, 32, 0.05);
}

.cockpit-body-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Split Pane for Live HUD (Players + Chat) */
.hud-split-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  height: 100%;
  padding: 16px 20px;
  overflow: hidden;
}

.hud-panel-box {
  background: #06080d;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.hud-panel-header {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  font-family: var(--font-mono);
}

.hud-player-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.hud-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.12s ease;
}

.hud-player-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.hud-player-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hud-player-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1e293b;
  color: #38bdf8;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.hud-chat-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.hud-chat-msg {
  display: flex;
  gap: 8px;
  line-height: 1.45;
  align-items: baseline;
}

.hud-chat-time {
  color: #475569;
  font-size: 10px;
  white-space: nowrap;
}

.hud-chat-sender {
  font-weight: 600;
  white-space: nowrap;
}

.hud-chat-sender.system {
  color: #38bdf8;
}

.hud-chat-sender.server {
  color: #f59e0b;
}

.hud-chat-sender.player {
  color: #34d399;
}

.hud-chat-text {
  color: #e2e8f0;
  word-break: break-word;
}

.hud-broadcast-form {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   Zero-Rollback Graceful Restart Modal
   ========================================================================== */

.graceful-card {
  max-width: 520px;
  background: #090c13;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.9);
  border-radius: 12px;
  overflow: hidden;
}

.graceful-timer-display {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 700;
  color: #fbbf24;
  text-align: center;
  padding: 12px 0 6px;
  letter-spacing: -0.02em;
}

.graceful-progress-bar {
  height: 6px;
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  margin: 12px 0 20px;
}

.graceful-progress-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #10b981, #f59e0b, #ef4444);
  transition: width 1s linear;
}

.graceful-step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: #94a3b8;
  transition: all 0.2s ease;
}

.graceful-step-item.active {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #ffffff;
}

.graceful-step-item.done {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
  color: #34d399;
}

/* ==========================================================================
   Threat Radar & Player Dossier
   ========================================================================== */

.dossier-card {
  max-width: 640px;
  background: #090c13;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  overflow: hidden;
}

.dossier-badge-clean {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
}

.dossier-badge-risk {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
}

@media (max-width: 900px) {
  .hud-split-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 240px 1fr;
  }
}

@media (max-width: 640px) {
  .linear-shell {
    padding: 20px 14px 48px;
    gap: 18px;
  }

  .linear-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .linear-header-right {
    width: 100%;
    justify-content: space-between;
  }

  .linear-search-wrap {
    width: 100%;
  }

  .linear-row {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
    gap: 12px;
  }

  .linear-row-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ==========================================================================
   RBAC, Workspace Switcher & Control Plane Navigation Extensions
   ========================================================================== */

.linear-workspace-select {
  background: #0c0e14;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.linear-workspace-select:hover,
.linear-workspace-select:focus {
  border-color: var(--amber-core);
}

.linear-role-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(232, 160, 32, 0.14);
  color: var(--amber-light);
  border: 1px solid rgba(232, 160, 32, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.linear-nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
  flex-wrap: wrap;
}

.linear-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.linear-nav-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.linear-nav-tab.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.linear-panel-card {
  background: #0c0e14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
}

.rbac-perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 10px;
}

.rbac-perm-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  padding: 11px 13px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s ease;
}

.rbac-perm-item:hover {
  border-color: rgba(232, 160, 32, 0.45);
  background: rgba(232, 160, 32, 0.04);
}

.rbac-perm-item input[type="checkbox"] {
  accent-color: var(--amber-core);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.rbac-perm-item span {
  font-family: var(--font-sans);
  color: #ffffff;
  font-weight: 600;
  font-size: 12.5px;
}

.rbac-perm-item code {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--amber-light);
  background: rgba(232, 160, 32, 0.12);
  border: 1px solid rgba(232, 160, 32, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: auto;
}

.rbac-perm-item small {
  width: 100%;
  padding-left: 23px;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.35;
  margin-left: 0;
}

/* Team & Roles Clean Layout */
.team-invite-bar {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 0.9fr;
  gap: 12px;
  align-items: end;
}

.team-field-label {
  font-size: 11px;
  color: #94a3b8;
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.team-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.team-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(232, 160, 32, 0.14);
  border: 1px solid rgba(232, 160, 32, 0.35);
  color: var(--amber-light);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.team-perm-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #cbd5e1;
}

@media (max-width: 900px) {
  .team-invite-bar,
  .team-split-grid {
    grid-template-columns: 1fr;
  }
}

.linear-act-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ==========================================================================
   Option 3: Tactical Left Rail + Contextual Sub-Bar Hybrid Architecture
   ========================================================================== */

.tactical-layout {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

.tactical-rail {
  width: 58px;
  background: #080a0f;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  padding: 14px 8px;
  position: relative;
  height: 100vh;
  z-index: 50;
  transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}

.tactical-rail.expanded {
  width: 210px;
}

.rail-top,
.rail-bottom {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 6px;
  cursor: pointer;
}

.rail-brand-text {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tactical-rail.expanded .rail-brand-text {
  opacity: 1;
}

.rail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-align: left;
  position: relative;
}

.rail-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.rail-item-label {
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.tactical-rail.expanded .rail-item-label {
  opacity: 1;
}

.rail-item:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.04);
}

.rail-item.active {
  color: var(--amber-light);
  background: rgba(232, 160, 32, 0.12);
  border-color: rgba(232, 160, 32, 0.3);
}

.rail-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  opacity: 0;
}

.tactical-rail.expanded .rail-badge {
  opacity: 1;
}

.tactical-main {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background: #0b0e17;
  position: relative;
}

.tactical-main .linear-shell {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 0 28px 64px;
}

/* Command Palette (Ctrl+K) */
.cmdk-box {
  background: #0c0e14;
  border: 1px solid rgba(232, 160, 32, 0.4);
  border-radius: 12px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}

.cmdk-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cmdk-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 14px;
  font-family: var(--font-sans);
}

.cmdk-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cmdk-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
  color: #cbd5e1;
  font-size: 12px;
  transition: background 0.12s ease;
}

.cmdk-item:hover {
  background: rgba(232, 160, 32, 0.14);
  color: #ffffff;
}

.cmdk-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
}

/* Node Hardware Matrix Cards (4 Real-Time Metrics) */
.nodes-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
}

.node-matrix-card {
  background: #0c0e14;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.node-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.node-metric-box {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.node-metric-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.node-metric-value {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-top: 2px;
}

.node-metric-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #64748b;
}

.node-bar-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.node-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #fbbf24);
  border-radius: 3px;
  transition: width 0.3s ease;
}

@media (max-width: 768px) {
  .nodes-matrix-grid,
  .node-metrics-grid {
    grid-template-columns: 1fr;
  }
  .tactical-layout {
    flex-direction: column;
  }
  .tactical-rail,
  .tactical-rail.expanded {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    padding: 8px 12px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
  }
  .rail-top,
  .rail-bottom {
    flex-direction: row;
    align-items: center;
  }
  .rail-brand {
    border-bottom: none;
    margin-bottom: 0;
    padding: 0 8px 0 0;
  }
  .rail-brand-text,
  .rail-item-label,
  .rail-badge,
  .rail-section-label {
    display: none;
  }
  .tactical-main .linear-shell {
    padding: 16px 14px 48px;
  }
}

.rail-section-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: #475569;
  padding: 6px 12px 2px;
  text-transform: uppercase;
  white-space: nowrap;
  display: none;
}

.tactical-rail.expanded .rail-section-label {
  display: block;
}


/* =========================================================================
   Zero-Knowledge Decentralized Control Plane: Master Node Offline Banner
   ========================================================================= */
.node-offline-banner {
  margin: 12px 0 18px 0;
  padding: 16px 20px;
  background: rgba(232, 160, 32, 0.08);
  border: 1px solid var(--amber-core, #E8A020);
  border-left: 4px solid var(--amber-core, #E8A020);
  border-radius: 6px;
  box-shadow: 0 0 20px var(--amber-glow, rgba(232, 160, 32, 0.15));
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  position: relative;
  overflow: hidden;
}

.node-offline-banner::after {
  content: " ";
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  opacity: 0.35;
}

.node-offline-banner h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--amber-light, #FFB834);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.node-offline-banner p {
  margin: 4px 0;
  font-size: 12px;
  line-height: 1.5;
  color: #e2e8f0;
}

.node-offline-banner .node-last-seen {
  margin-top: 8px;
  font-size: 11px;
  color: var(--amber-core, #E8A020);
  font-weight: 600;
}

.subuser-login-tab-btn {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted, #94a3b8);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.subuser-login-tab-btn.active {
  color: #ffffff;
  border-bottom: 2px solid var(--amber-core, #E8A020);
}
