:root {
  --bg-deep: #06090e;
  --bg-surface: #0c1017;
  --bg-card: rgba(14, 19, 27, 0.75);
  --bg-card-hover: rgba(19, 26, 38, 0.85);
  --bg-input: #121824;
  --bg-input-focus: #162030;
  
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-card: rgba(255, 255, 255, 0.09);
  --border-focus: #10b981;
  --border-glow: rgba(16, 185, 129, 0.25);
  
  --text-main: #f3f4f6;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --primary: #10b981;
  --primary-glow: rgba(16, 185, 129, 0.35);
  --primary-hover: #059669;
  
  --accent: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.35);
  
  --purple: #8b5cf6;
  --purple-glow: rgba(139, 92, 246, 0.35);
  
  --danger: #f43f5e;
  --danger-hover: #e11d48;
  --danger-glow: rgba(244, 63, 94, 0.35);
  
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.35);
  
  --terminal-bg: #030508;
  
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-card);
  --shadow-hover: 0 10px 30px -4px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.15);
  --shadow-glow: 0 0 25px -4px var(--primary-glow);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(16, 185, 129, 0.05), transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(6, 182, 212, 0.04), transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.02), transparent 60%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Header */
header {
  background: rgba(12, 16, 23, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: all 0.2s ease;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: #fff;
  user-select: none;
}

.logo-icon-wrapper {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  box-shadow: 0 0 15px -3px rgba(16, 185, 129, 0.4);
}

.logo-badge {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #04090d;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.675rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
}

.user-avatar {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
}

/* Layout */
main {
  flex: 1;
  padding: 2rem;
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
}

/* Cards & Glassmorphism */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.grid-cols-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Hero Metric Cards */
.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

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

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--card-accent, var(--primary)), transparent);
  opacity: 0.6;
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.metric-info {
  flex: 1;
}

.metric-info h4 {
  font-size: 0.775rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.metric-info p {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  margin-top: 0.15rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #04090d;
  font-weight: 700;
  box-shadow: 0 4px 14px -2px rgba(16, 185, 129, 0.4);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow: 0 6px 20px -2px rgba(16, 185, 129, 0.6);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.1);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e, #be123c);
  color: #fff;
  box-shadow: 0 4px 14px -2px rgba(244, 63, 94, 0.35);
}
.btn-danger:hover {
  background: linear-gradient(135deg, #fb7185, #e11d48);
  box-shadow: 0 6px 20px -2px rgba(244, 63, 94, 0.55);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #05080f;
  font-weight: 700;
  box-shadow: 0 4px 14px -2px rgba(245, 158, 11, 0.35);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Badges with Pulse Effects */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.725rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: capitalize;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.badge-online {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.badge-online .status-dot {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot 2s infinite ease-in-out;
}

.badge-offline {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}
.badge-offline .status-dot {
  background: #64748b;
}

.badge-starting {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.badge-starting .status-dot {
  background: #f59e0b;
  animation: pulse-dot 1s infinite;
}

.badge-flavor {
  background: rgba(6, 182, 212, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.3);
  text-transform: uppercase;
  font-size: 0.675rem;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Server Cards */
.server-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.server-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow-hover), 0 0 25px -4px rgba(16, 185, 129, 0.1);
}

.server-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.server-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.server-sub {
  color: var(--text-dim);
  font-size: 0.825rem;
  margin-top: 0.2rem;
}

.server-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1.1rem 0;
  background: rgba(6, 9, 14, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.stat-item {
  font-size: 0.8rem;
}
.stat-item .label {
  color: var(--text-dim);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  display: block;
}
.stat-item .val {
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.1rem;
  font-family: var(--font-mono);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  width: fit-content;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.55rem 1.15rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.tab-btn.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Terminal Console (Mac/Linux Studio Design) */
.terminal-container {
  background-color: var(--terminal-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 560px;
  overflow: hidden;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.8);
}

.terminal-header {
  background: rgba(14, 20, 30, 0.85);
  backdrop-filter: blur(8px);
  padding: 0.65rem 1.15rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.mac-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.mac-dot {
  width: 11px;
  height: 11px;
  border-radius: var(--radius-full);
}
.mac-dot.red { background: #ff5f56; }
.mac-dot.yellow { background: #ffbd2e; }
.mac-dot.green { background: #27c93f; }

.terminal-logs {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.825rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  color: #cbd5e1;
}

.terminal-line {
  margin-bottom: 2px;
}

.terminal-input-bar {
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 14, 22, 0.95);
  position: relative;
}

.terminal-prompt-sym {
  display: flex;
  align-items: center;
  padding-left: 1.15rem;
  color: var(--primary);
  font-family: var(--font-mono);
  font-weight: 700;
}

.terminal-input-bar input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.85rem 1rem 0.85rem 0.5rem;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  outline: none;
}

.terminal-input-bar button {
  background: rgba(16, 185, 129, 0.15);
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--primary);
  padding: 0 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.terminal-input-bar button:hover {
  background: var(--primary);
  color: #000;
}

/* File Manager Table */
.file-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.875rem;
}

.file-table th, .file-table td {
  padding: 0.85rem 1.15rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.file-table th {
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.02);
}

.file-row {
  transition: background-color 0.15s ease;
}

.file-row:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.file-name {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
  font-weight: 600;
}
.file-name:hover {
  color: var(--primary);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.25rem;
  animation: fadeIn 0.15s ease-out;
}

.modal-content {
  background: #0f1521;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8);
  animation: scaleUp 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}
.close-btn:hover {
  color: #fff;
}

/* Forms */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  background-color: var(--bg-input-focus);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 200;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid var(--primary);
  padding: 0.95rem 1.35rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.7);
  font-size: 0.875rem;
  font-weight: 600;
  animation: slideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.error {
  border-left-color: var(--danger);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
