:root {
  --bg-primary: #0a051b;
  --bg-card: rgba(20, 15, 45, 0.45);
  --border-card: rgba(255, 255, 255, 0.08);
  --color-text: #e2e1e9;
  --color-muted: #8b88a0;
  
  --primary: #8b5cf6;
  --primary-hover: #a78bfa;
  --accent: #06b6d4;
  --accent-hover: #22d3ee;
  
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  --font-family-sans: 'Outfit', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font-family-sans);
  background-color: var(--bg-primary);
  color: var(--color-text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding: 2rem 0;
}

/* Glassmorphism Background Gradients */
.glass-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: 
    radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.15) 0%, transparent 40%),
    linear-gradient(135deg, #070313 0%, #150d2e 100%);
}

.container {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* HEADER */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-card);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  position: relative;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.logo-icon::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  width: 24px;
  height: 24px;
  border: 3px solid #fff;
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  animation: spin 3s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #fff, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.system-status {
  display: flex;
  gap: 1.5rem;
}

.status-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--error);
  box-shadow: 0 0 10px var(--error);
}

.status-indicator.active {
  background-color: var(--success);
  box-shadow: 0 0 12px var(--success);
  animation: pulse 2s infinite;
}

.status-indicator.warning {
  background-color: var(--warning);
  box-shadow: 0 0 12px var(--warning);
}

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

.status-label {
  font-size: 0.75rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-val {
  font-weight: 600;
  font-size: 0.95rem;
}

/* LAYOUT GRID */
.grid-layout {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 2rem;
}

@media (max-width: 992px) {
  .grid-layout {
    grid-template-columns: 1fr;
  }
}

/* CARDS */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: border-color 0.3s, transform 0.3s;
}

.glass-card:hover {
  border-color: rgba(139, 92, 246, 0.2);
}

.glass-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.4;
}

/* FORMS */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
}

input, select, textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.75rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.3s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

select option {
  background: #110d29;
  color: #fff;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #6d28d9 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, #0891b2 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-accent:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
  transform: translateY(-1px);
}

.btn-text {
  background: transparent;
  color: var(--primary-hover);
  padding: 0.5rem 1rem;
}

.btn-text:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* TABLES */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tasks-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-card);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.tasks-table-container.mini {
  max-height: 250px;
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.data-table th, .data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-card);
  white-space: nowrap;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table th {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

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

.empty-state {
  text-align: center;
  color: var(--color-muted);
  padding: 2rem !important;
}

/* BADGES */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-running { background: rgba(59, 130, 246, 0.15); color: var(--info); border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-completed { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-failed { background: rgba(239, 68, 68, 0.15); color: var(--error); border: 1px solid rgba(239, 68, 68, 0.3); }

/* TABS */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-card);
  gap: 1rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--color-muted);
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  position: relative;
  transition: color 0.3s;
}

.tab-btn:hover {
  color: var(--color-text);
}

.tab-btn.active {
  color: var(--primary-hover);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.tab-content {
  display: none;
}

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

/* MODAL */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

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

.modal-content {
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: translateY(-20px);
  transition: transform 0.3s;
}

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

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

.modal-title {
  font-size: 1.4rem;
  font-weight: 700;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--color-muted);
  font-size: 1.8rem;
  cursor: pointer;
}

.close-btn:hover {
  color: #fff;
}

.modal-body {
  padding-top: 1rem;
}

/* DATA RENDERING */
pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  color: #a78bfa;
  font-family: monospace;
  font-size: 0.85rem;
  max-height: 400px;
}

.profile-preview h4 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.profile-preview .headline {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.profile-preview .meta {
  font-size: 0.85rem;
  color: var(--accent-hover);
  margin-bottom: 1rem;
}

.profile-preview .section {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-card);
  padding-top: 1rem;
}

.profile-preview .section h5 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--primary-hover);
}

.list-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.list-item-title {
  font-weight: 600;
}

.list-item-subtitle {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 0.25rem;
}

/* TERMINAL SCREEN */
.terminal-container {
  background: rgba(5, 2, 15, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 1rem;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9);
  position: relative;
  overflow: hidden;
}

.terminal-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, var(--primary), var(--accent));
}

.terminal-logs {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  color: #a78bfa;
  height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
  padding-right: 0.5rem;
}

/* Custom scrollbar for terminal */
.terminal-logs::-webkit-scrollbar {
  width: 6px;
}
.terminal-logs::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
.terminal-logs::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

/* REMOTE LOGIN HELPER */
.login-status-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.status-inactive {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.status-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
  animation: pulse 2s infinite;
}

.btn-group {
  display: flex;
  gap: 1rem;
}

.instructions-panel {
  background: rgba(5, 2, 15, 0.5);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);
}

