/* ═══════════════════════════════════════════════════════════
   VPS Panel - Complete Design System
   Arabic RTL | Glassmorphism | Dark Mode
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Inter:wght@400;500;600&display=swap');

/* ─── CSS Variables ─────────────────────────────────────── */
:root {
  --bg: #08090e;
  --bg2: #0d0f18;
  --bg3: #13151b;
  --bg4: #1a1c26;
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.14);
  --text: #f1f5f9;
  --text2: #94a3b8;
  --text3: #475569;
  --primary: #6366f1;
  --primary-hover: #5254cc;
  --primary-glow: rgba(99, 102, 241, 0.2);
  --primary-glow-strong: rgba(99, 102, 241, 0.35);
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --online: #22c55e;
  --offline: #475569;
  --error: #ef4444;
  --card-bg: rgba(255, 255, 255, 0.03);
  --glass: rgba(13, 15, 24, 0.85);
  --sidebar-w: 260px;
  --header-h: 64px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --transition: 0.2s ease;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.6);
  --shadow-primary: 0 4px 20px rgba(99, 102, 241, 0.3);
}

/* ─── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  direction: rtl;
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'IBM Plex Sans Arabic', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

img { max-width: 100%; }

/* ─── Typography ────────────────────────────────────────── */
h1 { font-size: 1.8rem; font-weight: 700; }
h2 { font-size: 1.4rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; }

.mono { font-family: 'JetBrains Mono', monospace; }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.72rem; }
.text-muted { color: var(--text2); }
.text-dimmed { color: var(--text3); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }

/* ─── Layout ─────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.main-wrapper {
  flex: 1;
  margin-right: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  height: var(--header-h);
  background: rgba(13, 15, 24, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.main-content {
  flex: 1;
  padding: 24px;
}

.page-section { display: none; }
.page-section.active { display: block; }

/* ─── Sidebar ─────────────────────────────────────────────── */
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-primary);
}

.logo-text { font-weight: 700; font-size: 1rem; }
.logo-sub { font-size: 0.72rem; color: var(--text3); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 0;
  transition: all var(--transition);
  color: var(--text2);
  font-size: 0.88rem;
  position: relative;
  border-right: 3px solid transparent;
}

.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item.active {
  background: var(--primary-glow);
  color: var(--primary);
  border-right-color: var(--primary);
}

.nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.nav-item .nav-badge {
  margin-right: auto; background: var(--danger);
  color: #fff; font-size: 0.65rem; font-weight: 600;
  padding: 2px 7px; border-radius: 20px; min-width: 20px; text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.server-status-mini {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.75rem; color: var(--text2);
}

/* ─── Header ──────────────────────────────────────────────── */
.hamburger {
  background: none; border: none; cursor: pointer;
  color: var(--text2); font-size: 1.2rem; padding: 4px;
  display: none;
}

.header-title { font-size: 1.1rem; font-weight: 600; flex: 1; }

.header-actions { display: flex; align-items: center; gap: 12px; }

.notif-btn {
  position: relative; background: none; border: none;
  cursor: pointer; color: var(--text2); font-size: 1.1rem;
  padding: 8px; border-radius: var(--radius-xs);
  transition: all var(--transition);
}
.notif-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.notif-badge {
  position: absolute; top: 2px; left: 2px;
  background: var(--danger); color: #fff;
  font-size: 0.6rem; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.user-badge {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-xs); padding: 6px 12px;
  font-size: 0.8rem; cursor: pointer;
  transition: all var(--transition);
}
.user-badge:hover { border-color: var(--border-hover); }

.connection-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
}
.connection-dot.offline { background: var(--danger); animation: none; }

/* ─── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  padding: 20px;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--border-hover); }

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

.card-title {
  font-size: 0.9rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}

/* ─── Stat Cards ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: flex-start; gap: 14px;
  position: relative; overflow: hidden;
  transition: all var(--transition);
}
.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,0.04) 0%, transparent 60%);
  pointer-events: none;
}

.stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.stat-icon.cpu { background: rgba(99, 102, 241, 0.15); }
.stat-icon.ram { background: rgba(34, 197, 94, 0.15); }
.stat-icon.disk { background: rgba(245, 158, 11, 0.15); }
.stat-icon.uptime { background: rgba(139, 92, 246, 0.15); }
.stat-icon.bots { background: rgba(20, 184, 166, 0.15); }

.stat-label { font-size: 0.75rem; color: var(--text2); margin-bottom: 4px; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-sub { font-size: 0.72rem; color: var(--text3); margin-top: 4px; }

/* ─── Progress Bars ───────────────────────────────────────── */
.progress-bar {
  height: 4px; background: var(--bg4);
  border-radius: 2px; margin-top: 8px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 2px;
  background: var(--primary);
  transition: width 0.5s ease;
}
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger { background: var(--danger); }
.progress-fill.success { background: var(--success); }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-xs);
  font-size: 0.82rem; font-weight: 500;
  font-family: inherit; cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger-bg); color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover:not(:disabled) { background: rgba(239, 68, 68, 0.2); }

.btn-success {
  background: var(--success-bg); color: var(--success);
  border-color: rgba(34, 197, 94, 0.3);
}
.btn-success:hover:not(:disabled) { background: rgba(34, 197, 94, 0.2); }

.btn-warning {
  background: var(--warning-bg); color: var(--warning);
  border-color: rgba(245, 158, 11, 0.3);
}
.btn-warning:hover:not(:disabled) { background: rgba(245, 158, 11, 0.2); }

.btn-ghost {
  background: transparent; color: var(--text2);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.04); color: var(--text); border-color: var(--border-hover); }

.btn-icon {
  padding: 6px 8px;
  background: none; border: 1px solid var(--border);
  color: var(--text2); cursor: pointer; border-radius: var(--radius-xs);
  transition: all var(--transition); font-size: 0.9rem;
}
.btn-icon:hover { background: rgba(255,255,255,0.06); color: var(--text); }

.btn-sm { padding: 5px 10px; font-size: 0.75rem; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }

/* ─── Form Inputs ─────────────────────────────────────────── */
.input, .select, .textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 9px 12px;
  transition: all var(--transition);
  outline: none;
  direction: rtl;
}

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

.input::placeholder { color: var(--text3); }

.select { appearance: none; cursor: pointer; }
.select option { background: var(--bg3); }

.textarea { resize: vertical; min-height: 80px; }

.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 0.8rem; font-weight: 500;
  color: var(--text2); margin-bottom: 6px;
}

.input-group {
  display: flex; gap: 8px;
}
.input-group .input { flex: 1; }

/* ─── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

table {
  width: 100%; border-collapse: collapse;
  background: var(--card-bg); border-radius: var(--radius);
  overflow: hidden;
}

thead { background: var(--bg3); }
th {
  padding: 12px 16px; text-align: right;
  font-size: 0.75rem; font-weight: 600;
  color: var(--text3); text-transform: uppercase;
  letter-spacing: 0.05em; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-size: 0.82rem; vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: rgba(255,255,255,0.02); }

.table-actions { display: flex; gap: 6px; align-items: center; }

/* ─── Status Dots ─────────────────────────────────────────── */
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; vertical-align: middle;
  margin-left: 6px;
}
.status-dot.online {
  background: var(--online);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: pulse-green 2s infinite;
}
.status-dot.offline { background: var(--offline); }
.status-dot.warning { background: var(--warning); }
.status-dot.error { background: var(--error); animation: pulse-red 2s infinite; }

@keyframes pulse-green {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
@keyframes pulse-red {
  0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ─── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-neutral { background: rgba(255,255,255,0.06); color: var(--text2); }

/* ─── Modals ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  width: 90%; max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh; overflow-y: auto;
}
.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-lg { max-width: 680px; }
.modal-xl { max-width: 900px; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 1.1rem; padding: 4px;
  border-radius: 4px; transition: all var(--transition);
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.modal-footer {
  display: flex; gap: 10px; justify-content: flex-start;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ─── Toast Notifications ─────────────────────────────────── */
.toast-container {
  position: fixed; top: 20px; left: 20px;
  z-index: 2000; display: flex;
  flex-direction: column; gap: 10px;
}

.toast {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  min-width: 280px; max-width: 360px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: flex-start; gap: 10px;
  transform: translateX(-120%);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.show { transform: translateX(0); }
.toast.hide { transform: translateX(-120%); }

.toast-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.toast-content { flex: 1; }
.toast-title { font-size: 0.82rem; font-weight: 600; margin-bottom: 2px; }
.toast-msg { font-size: 0.76rem; color: var(--text2); }

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--primary); }

/* ─── File Manager ────────────────────────────────────────── */
.fm-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}

.fm-path-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-xs); padding: 6px 12px;
  flex: 1; min-width: 200px;
}
.fm-path-bar input {
  background: none; border: none; color: var(--text);
  font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
  outline: none; flex: 1; direction: ltr; text-align: left;
}

.fm-breadcrumb {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.78rem; color: var(--text2);
  flex-wrap: wrap; margin-bottom: 12px;
}
.fm-breadcrumb span {
  cursor: pointer; transition: color var(--transition);
}
.fm-breadcrumb span:hover { color: var(--primary); }
.fm-breadcrumb .sep { color: var(--text3); }

.fm-files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.fm-files-list { display: flex; flex-direction: column; gap: 2px; }

.fm-item {
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer; transition: all var(--transition);
  user-select: none; position: relative;
}

.fm-item.grid-item {
  padding: 16px 10px; text-align: center;
  background: var(--card-bg);
}
.fm-item.grid-item:hover { border-color: var(--border); background: var(--bg3); }
.fm-item.grid-item.selected { border-color: var(--primary); background: var(--primary-glow); }

.fm-item.list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: none;
}
.fm-item.list-item:hover { background: rgba(255,255,255,0.03); border-color: var(--border); }
.fm-item.list-item.selected { background: var(--primary-glow); border-color: var(--primary); }

.fm-icon { font-size: 2rem; margin-bottom: 6px; display: block; }
.fm-item.list-item .fm-icon { font-size: 1.1rem; margin: 0; flex-shrink: 0; }

.fm-name {
  font-size: 0.75rem; word-break: break-all;
  color: var(--text); display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.fm-item.list-item .fm-name { font-size: 0.82rem; flex: 1; }

.fm-meta { font-size: 0.65rem; color: var(--text3); margin-top: 4px; }
.fm-item.list-item .fm-meta { font-size: 0.72rem; margin-right: auto; }

.fm-drag-over { border-color: var(--primary) !important; background: var(--primary-glow) !important; }

.trash-zone {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--radius-xs);
  border: 1px dashed var(--border); color: var(--text3);
  font-size: 0.8rem; cursor: default; transition: all var(--transition);
}
.trash-zone.drag-over {
  border-color: var(--danger); background: var(--danger-bg);
  color: var(--danger);
}

/* Context Menu */
.context-menu {
  position: fixed; z-index: 1500;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 0;
  box-shadow: var(--shadow-lg); min-width: 160px;
  display: none;
}
.context-menu.show { display: block; }
.ctx-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; font-size: 0.8rem;
  cursor: pointer; color: var(--text2); transition: all var(--transition);
}
.ctx-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: var(--danger-bg); }
.ctx-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ─── Code Editor ─────────────────────────────────────────── */
.editor-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: var(--bg);
  display: none; flex-direction: column;
}
.editor-overlay.open { display: flex; }

.editor-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; background: var(--bg2);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.editor-title { font-size: 0.85rem; font-family: 'JetBrains Mono', monospace; flex: 1; }
.editor-wrap { flex: 1; overflow: hidden; }
.CodeMirror { height: 100% !important; font-size: 13px !important; }

/* ─── Terminal ────────────────────────────────────────────── */
.terminal {
  background: #0a0b0f; border-radius: var(--radius-sm);
  padding: 16px; font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem; overflow-y: auto; direction: ltr;
  text-align: left; line-height: 1.6;
}

.terminal-line { color: #94a3b8; }
.terminal-line.output { color: #e2e8f0; }
.terminal-line.error { color: #f87171; }
.terminal-line.info { color: #60a5fa; }
.terminal-line.success { color: #4ade80; }

.terminal-input-row {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
}
.terminal-prompt { color: var(--success); font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; white-space: nowrap; }
.terminal-input {
  flex: 1; background: none; border: none; color: var(--text);
  font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
  outline: none; direction: ltr;
}

/* ─── Bot Manager ─────────────────────────────────────────── */
.bot-logs-panel {
  background: #0a0b0f; border-radius: var(--radius-sm);
  padding: 12px; font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem; max-height: 300px; overflow-y: auto;
  direction: ltr; text-align: left; color: #94a3b8;
  border: 1px solid var(--border);
}

/* ─── Sites Cards ─────────────────────────────────────────── */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.site-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
}
.site-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow); }

.site-card-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.site-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}

/* ─── Notifications Dropdown ──────────────────────────────── */
.notif-dropdown {
  position: absolute; top: calc(var(--header-h) - 6px); left: 20px;
  width: 320px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 200;
  max-height: 400px; overflow-y: auto;
  display: none;
}
.notif-dropdown.open { display: block; }

.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-size: 0.85rem; font-weight: 600; position: sticky; top: 0;
  background: var(--bg2);
}

.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  transition: background var(--transition); cursor: pointer;
}
.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-item:last-child { border-bottom: none; }

.notif-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.notif-text { flex: 1; }
.notif-text h5 { font-size: 0.8rem; font-weight: 600; margin-bottom: 2px; }
.notif-text p { font-size: 0.74rem; color: var(--text2); }

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

.qr-container {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 20px; background: var(--bg3);
  border-radius: var(--radius-sm); text-align: center;
}

.qr-container img { border-radius: 8px; }

/* ─── Loading ─────────────────────────────────────────────── */
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }

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

.loading-overlay {
  position: absolute; inset: 0; background: rgba(8, 9, 14, 0.7);
  backdrop-filter: blur(4px); border-radius: inherit;
  display: flex; align-items: center; justify-content: center; z-index: 10;
}

/* ─── Empty State ─────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px; text-align: center;
  color: var(--text3);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }
.empty-state h3 { font-size: 0.95rem; color: var(--text2); margin-bottom: 6px; }
.empty-state p { font-size: 0.8rem; }

/* ─── Toggle Switch ───────────────────────────────────────── */
.toggle {
  position: relative; display: inline-block;
  width: 44px; height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg4); border-radius: 24px;
  transition: var(--transition);
}
.toggle-slider::before {
  position: absolute; content: '';
  height: 18px; width: 18px; right: 3px; bottom: 3px;
  background: white; border-radius: 50%;
  transition: var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(-20px); }

/* ─── Section Headers ─────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.section-title { font-size: 1.1rem; font-weight: 700; }

/* ─── Divider ─────────────────────────────────────────────── */
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ─── Grid Helpers ────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); width: 260px; box-shadow: var(--shadow-lg); }
  .main-wrapper { margin-right: 0; }
  .hamburger { display: block; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ─── Login Page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  position: relative; overflow: hidden;
}

.login-bg {
  position: absolute; inset: 0; pointer-events: none;
}

.login-bg-blob {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.15;
}
.blob-1 { width: 500px; height: 500px; background: var(--primary); top: -100px; right: -100px; animation: float 8s ease-in-out infinite; }
.blob-2 { width: 400px; height: 400px; background: #8b5cf6; bottom: -100px; left: -100px; animation: float 10s ease-in-out infinite reverse; }

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

.login-card {
  background: rgba(13, 15, 24, 0.85);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  width: 90%; max-width: 400px;
  box-shadow: var(--shadow-lg);
  position: relative; z-index: 1;
}

.login-logo {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; margin-bottom: 32px; text-align: center;
}

.login-logo-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
  animation: float 4s ease-in-out infinite;
}

.login-title { font-size: 1.4rem; font-weight: 700; }
.login-sub { font-size: 0.8rem; color: var(--text2); }

/* ─── Blocked Page ────────────────────────────────────────── */
.blocked-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}

.blocked-card {
  background: var(--bg2); border: 1px solid rgba(239,68,68,0.3);
  border-radius: 20px; padding: 40px; text-align: center;
  max-width: 400px; width: 90%;
  box-shadow: 0 8px 48px rgba(239, 68, 68, 0.2);
}

.blocked-icon { font-size: 4rem; margin-bottom: 16px; }

/* ─── Misc Utilities ──────────────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.overflow-hidden { overflow: hidden; }

/* ─── VS Code / Antigravity IDE Styling ────────────────────────────────────── */

.vscode-top-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #181a1f;
  border-bottom: 1px solid #282c34;
  padding: 4px 12px;
  font-size: 0.78rem;
  color: #abb2bf;
  direction: ltr;
  user-select: none;
}

.vscode-menu-item {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}

.vscode-menu-item:hover {
  background: #2c313a;
  color: #fff;
}

.vscode-tabs-bar {
  display: flex;
  align-items: center;
  background: #181a1f;
  border-bottom: 1px solid #282c34;
  overflow-x: auto;
  direction: ltr;
}

.vscode-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #21252b;
  color: #9da5b4;
  border-right: 1px solid #181a1f;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  cursor: pointer;
  user-select: none;
}

.vscode-tab.active {
  background: #282c34;
  color: #61afef;
  border-bottom: 2px solid #61afef;
}

.vscode-tab-close {
  font-size: 0.7rem;
  padding: 1px 4px;
  border-radius: 50%;
}
.vscode-tab-close:hover {
  background: rgba(255,255,255,0.15);
}

.vscode-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #181a1f;
  border-top: 1px solid #282c34;
  padding: 2px 12px;
  font-size: 0.75rem;
  color: #9da5b4;
  direction: ltr;
}

/* ─── VS Code / Antigravity IDE Pixel-Perfect Styling ─────────────────── */

.studio-ltr-container {
  direction: ltr !important;
  text-align: left !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.vscode-activity-bar {
  width: 48px;
  background: #181818;
  border-right: 1px solid #2b2b2b;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0;
  gap: 12px;
  color: #858585;
  user-select: none;
  flex-shrink: 0;
}

.vscode-activity-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  font-size: 1.15rem;
  transition: all 0.1s ease;
  position: relative;
  color: #858585;
}

.vscode-activity-icon:hover {
  color: #ffffff;
}

.vscode-activity-icon.active {
  color: #ffffff;
}

.vscode-activity-icon.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #ffffff;
}

.vscode-top-bar {
  display: flex;
  align-items: center;
  height: 35px;
  background: #181818;
  border-bottom: 1px solid #2b2b2b;
  padding: 0 10px;
  font-size: 0.76rem;
  color: #cccccc;
  direction: ltr;
  user-select: none;
}

.vscode-menu-item {
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 4px;
  color: #cccccc;
  font-size: 0.76rem;
  transition: background 0.1s ease;
}

.vscode-menu-item:hover {
  background: #2a2d2e;
  color: #ffffff;
}

.vscode-dropdown-menu {
  position: absolute;
  top: 32px;
  left: 0;
  background: #1f1f1f;
  border: 1px solid #454545;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  min-width: 260px;
  padding: 4px 0;
  z-index: 9999;
  display: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #cccccc;
  direction: ltr;
  text-align: left;
}

.vscode-dropdown-menu.show {
  display: block;
}

.vscode-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  font-size: 0.76rem;
  cursor: pointer;
  user-select: none;
}

.vscode-dropdown-item:hover {
  background: #04395e;
  color: #ffffff;
}

.vscode-dropdown-shortcut {
  color: #858585;
  font-size: 0.7rem;
  margin-left: 20px;
}

.vscode-dropdown-divider {
  height: 1px;
  background: #333333;
  margin: 4px 0;
}

.vscode-tabs-bar {
  display: flex;
  align-items: center;
  height: 35px;
  background: #181818;
  border-bottom: 1px solid #2b2b2b;
  overflow-x: auto;
  direction: ltr;
}

.vscode-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 35px;
  padding: 0 14px;
  background: #181818;
  color: #858585;
  border-right: 1px solid #252525;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.76rem;
  cursor: pointer;
  user-select: none;
}

.vscode-tab.active {
  background: #1e1e1e;
  color: #ffffff;
  border-top: 1px solid #007fd4;
}

.vscode-tab-close {
  font-size: 0.7rem;
  padding: 1px 4px;
  border-radius: 3px;
}
.vscode-tab-close:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.vscode-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
  background: #181818;
  border-top: 1px solid #2b2b2b;
  padding: 0 10px;
  font-size: 0.72rem;
  color: #858585;
  direction: ltr;
  user-select: none;
}

.vscode-model-popover {
  position: absolute;
  bottom: 50px;
  right: 12px;
  width: 290px;
  background: #1f1f1f;
  border: 1px solid #007fd4;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.8);
  z-index: 9999;
  display: none;
  padding: 6px;
  direction: ltr;
}

.vscode-model-popover.show {
  display: block;
}

.vscode-model-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.76rem;
  color: #cccccc;
  cursor: pointer;
  transition: background 0.1s;
}

.vscode-model-option:hover {
  background: #2a2d2e;
  color: #ffffff;
}

.vscode-model-option.active {
  background: #04395e;
  color: #ffffff;
  font-weight: 600;
}

/* File Tree Custom Style */
.tree-item-file {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 18px;
  font-size: 0.76rem;
  color: #cccccc;
  cursor: pointer;
  border-radius: 3px;
  font-family: 'JetBrains Mono', Consolas, monospace;
}
.tree-item-file:hover {
  background: #2a2d2e;
  color: #ffffff;
}
.tree-item-folder {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-size: 0.76rem;
  color: #cccccc;
  cursor: pointer;
  font-weight: 600;
  border-radius: 3px;
}
.tree-item-folder:hover {
  background: #2a2d2e;
  color: #ffffff;
}

/* Vercel & Firebase Deploy Box Styles */
.drop-zone:hover {
  border-color: #61afef !important;
  background: rgba(97, 175, 239, 0.08) !important;
}

.drop-zone.dragover {
  border-color: #98c379 !important;
  background: rgba(152, 195, 121, 0.15) !important;
}

