:root {
  --bg-deep: #090d16;
  --bg-surface: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.7);
  --border-subtle: rgba(148, 163, 184, 0.12);
  --border-glow: rgba(59, 130, 246, 0.4);
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.25);

  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.25);
  
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --pink: #ec4899;
  --purple: #8b5cf6;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Ambient glow */
.ambient-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 350px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, rgba(139, 92, 246, 0.05) 50%, transparent 80%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.app-layout {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px;
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 20px;
}

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

.brand-badge {
  position: relative;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.shield-icon {
  font-size: 26px;
}

.pulse-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success);
}

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

.brand-title-row h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.version-tag {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

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

/* Metrics Grid */
.metrics-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 140px;
  transition: transform 0.2s, border-color 0.2s;
}

.metric-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.metric-card.active {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.1);
}

.metric-icon {
  font-size: 20px;
}

.metric-info {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.metric-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.text-success { color: var(--success) !important; }
.text-primary { color: var(--primary) !important; }
.text-warning { color: var(--warning) !important; }

/* Quick Action Bar */
.quick-action-bar {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.action-bar-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.action-buttons-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.action-pill {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.action-pill.primary {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}
.action-pill.primary:hover {
  background: var(--primary);
  color: white;
}

.action-pill.info {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border-color: rgba(6, 182, 212, 0.3);
}
.action-pill.info:hover {
  background: var(--info);
  color: white;
}

.action-pill.pink {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border-color: rgba(236, 72, 153, 0.3);
}
.action-pill.pink:hover {
  background: var(--pink);
  color: white;
}

.action-pill.purple {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.3);
}
.action-pill.purple:hover {
  background: var(--purple);
  color: white;
}

.action-pill.green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}
.action-pill.green:hover {
  background: var(--success);
  color: white;
}

.action-pill.secondary {
  background: rgba(148, 163, 184, 0.1);
  color: #cbd5e1;
  border-color: var(--border-subtle);
}
.action-pill.secondary:hover {
  background: rgba(148, 163, 184, 0.25);
  color: white;
}

/* Nav Tabs */
.nav-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
  overflow-x: auto;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.nav-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}

/* Tab Pane */
.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-out forwards;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 16px;
}

.pane-header h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.pane-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.pane-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.mt-3 { margin-top: 20px; }
.mt-4 { margin-top: 36px; }

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(51, 65, 85, 0.6);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover {
  background: rgba(71, 85, 105, 0.8);
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover {
  background: #dc2626;
}

.btn-info {
  background: var(--info);
  color: #0f172a;
}
.btn-info:hover {
  background: #0891b2;
  color: white;
}

.btn-pink {
  background: var(--pink);
  color: white;
}
.btn-pink:hover {
  background: #db2777;
}

.btn-purple {
  background: var(--purple);
  color: white;
}
.btn-purple:hover {
  background: #7c3aed;
}

.btn-hero {
  padding: 14px 28px;
  font-size: 15px;
  border-radius: var(--radius);
  width: 100%;
}

.btn-group {
  display: flex;
  gap: 10px;
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Profiles Grid */
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.profile-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.profile-card:hover {
  border-color: rgba(148, 163, 184, 0.3);
  transform: translateY(-2px);
}

.profile-card.running {
  border-color: var(--success);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.15);
}

.profile-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.avatar-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-right: 12px;
}

.profile-meta-head {
  display: flex;
  align-items: center;
}

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

.profile-id-sub {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.status-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.status-pill.idle {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.status-pill.running {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Warmup Progress Bar */
.warmup-box {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.warmup-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.warmup-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.warmup-fill {
  height: 100%;
  background: linear-gradient(to right, var(--primary), var(--success));
  border-radius: 3px;
  transition: width 0.3s;
}

/* Card Details */
.card-info-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.info-row strong {
  color: var(--text-main);
  font-weight: 600;
}

.proxy-shield {
  color: var(--info);
  font-size: 12px;
}

/* Profile Card Buttons */
.card-btn-row {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.card-btn-row .btn {
  flex: 1;
}

.btn-launch-hero {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  font-size: 13px;
  padding: 10px;
}
.btn-launch-hero:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.form-col.full {
  grid-column: 1 / -1;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

.code-font {
  font-family: var(--font-mono);
  font-size: 13px;
}

/* Toggle Switch */
.flex-center {
  display: flex;
  align-items: center;
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.toggle-container input {
  display: none;
}

.toggle-slider {
  width: 44px;
  height: 24px;
  background: #334155;
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-container input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-container input:checked + .toggle-slider::after {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

/* Custom Table */
.table-wrap {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.custom-table th {
  background: rgba(15, 23, 42, 0.9);
  padding: 14px 18px;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border-subtle);
}

.custom-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Terminal Box */
.terminal-box {
  background: #020617;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  height: 520px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.terminal-line {
  display: flex;
  gap: 12px;
  line-height: 1.6;
}

.terminal-time {
  color: var(--text-dim);
}

.terminal-tag {
  color: #38bdf8;
  font-weight: 700;
}

.terminal-text {
  color: #e2e8f0;
}

.terminal-line.error .terminal-text {
  color: var(--danger);
}

/* Modals */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-backdrop.active {
  display: flex;
}

.modal-window {
  background: #111827;
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  width: 90%;
  max-width: 540px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 26px;
  cursor: pointer;
}

.modal-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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