/**
 * Vortex Fleet — theme matched to Vortex Premium (matrix + purple glass)
 */
:root {
  --dark-bg: #000000;
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --text-muted: #666666;
  --border-color: #333333;
  --card-bg: #1a1a1a;
  --danger-color: #ff4444;
  --success-color: #00cc66;
  --vx-accent: #38bdf8;
  --purple: #a855f7;
  --purple-2: #7c3aed;
  --purple-3: #c084fc;
}

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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--dark-bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

body.vortex-matrix {
  background: #000 !important;
  position: relative;
  min-height: 100vh;
}

.matrix-rain-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ===== LOGIN (Premium) ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000 !important;
  position: relative;
  overflow: hidden;
}

.login-page .login-container,
.login-page .login-box {
  position: relative;
  z-index: 20;
}

.login-container {
  width: 100%;
  max-width: 460px;
  padding: 20px;
}

.login-box {
  background: linear-gradient(160deg, rgba(14, 8, 24, 0.82), rgba(8, 4, 16, 0.62));
  border: 1px solid rgba(168, 85, 247, 0.38);
  border-radius: 20px;
  padding: 40px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.62),
    0 0 40px rgba(124, 58, 237, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  animation: slideUp 0.6s ease-out;
}

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

.login-header { text-align: center; margin-bottom: 30px; }

.logo-container {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  padding: 2px;
  background: linear-gradient(135deg, #c084fc, #7c3aed);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 2px rgba(124, 58, 237, 0.25),
    0 0 24px rgba(168, 85, 247, 0.45);
}

.login-logo-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  border: 2px solid rgba(10, 5, 20, 0.9);
}

.login-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 5px;
  background: linear-gradient(135deg, #f3e8ff, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle { color: var(--text-secondary); font-size: 14px; }

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  background: #000;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
}

.form-control:focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.25);
}

.login-footer {
  margin-top: 22px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.alert {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 13px;
}
.alert-danger {
  background: rgba(255, 68, 68, 0.12);
  border: 1px solid rgba(255, 68, 68, 0.35);
  color: #ff8a8a;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.2s ease;
  color: #fff;
  background: #1a1a1a;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, #c084fc, #7c3aed);
  box-shadow: 0 5px 20px rgba(124, 58, 237, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-info {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}
.btn-warning { background: #f59e0b; color: #000; }
.btn-danger { background: var(--danger-color); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 8px; }

/* ===== DASHBOARD ===== */
.dashboard { position: relative; z-index: 2; min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  z-index: 200;
  background: linear-gradient(180deg, rgba(14, 8, 24, 0.94), rgba(8, 4, 16, 0.9));
  border-right: 1px solid rgba(168, 85, 247, 0.32);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
  padding: 4px 6px;
}
.sidebar-logo {
  width: 36px;
  height: 36px;
  margin: 0;
  flex-shrink: 0;
}
.sidebar-brand strong {
  display: block;
  font-size: 14px;
  background: linear-gradient(135deg, #f3e8ff, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-brand span {
  display: block;
  font-size: 11px;
  color: #64748b;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav-item {
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
}
.nav-item:hover {
  background: rgba(168, 85, 247, 0.1);
  color: #e9d5ff;
}
.nav-item.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.28);
  color: #7dd3fc;
}

.sidebar-foot {
  border-top: 1px solid rgba(168, 85, 247, 0.2);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-label { font-size: 12px; color: #94a3b8; }

.main-content {
  margin-left: 260px;
  width: calc(100% - 260px);
  min-height: 100vh;
  padding: 20px 22px 48px;
  position: relative;
  z-index: 2;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.page-head h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.page-sub { color: #94a3b8; font-size: 13px; }

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.stat {
  background: rgba(14, 8, 24, 0.62);
  border: 1px solid rgba(168, 85, 247, 0.28);
  border-radius: 12px;
  padding: 12px 14px;
  backdrop-filter: blur(8px);
}
.stat b {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.03em;
}
.stat span { color: #64748b; font-size: 11px; }

.alerts-bar {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: rgba(245, 158, 11, 0.1);
  font-size: 13px;
}
.alerts-bar .item { margin: 4px 0; color: #fde68a; }

.panel-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 14px;
}

.panel {
  background: rgba(14, 8, 24, 0.62);
  border: 1px solid rgba(168, 85, 247, 0.28);
  border-radius: 14px;
  padding: 14px;
  backdrop-filter: blur(10px);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.panel-head h2 {
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
}

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.create-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.create-bar input[type="number"] { width: 72px; }

input, select, textarea {
  font: inherit;
  color: #e2e8f0;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  padding: 8px 10px;
}
textarea { width: 100%; margin-bottom: 10px; resize: vertical; }

.table-wrap { overflow: auto; max-height: 560px; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: #cbd5e1;
}
.data-table th,
.data-table td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}
.data-table th {
  position: sticky;
  top: 0;
  background: rgba(15, 23, 42, 0.95);
  color: #64748b;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.data-table tr { cursor: pointer; }
.data-table tr:hover td { background: rgba(56, 189, 248, 0.06); }
.data-table tr.active td { background: rgba(168, 85, 247, 0.12); }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 11px;
  text-transform: lowercase;
}
.pill.ok { border-color: rgba(34, 197, 94, 0.4); color: #4ade80; background: rgba(34, 197, 94, 0.1); }
.pill.warn { border-color: rgba(251, 191, 36, 0.4); color: #fbbf24; background: rgba(251, 191, 36, 0.1); }
.pill.danger { border-color: rgba(251, 113, 133, 0.45); color: #fb7185; background: rgba(251, 113, 133, 0.1); }
.pill.muted { color: #64748b; }

.detail .empty { color: #64748b; padding: 24px 8px; }
.screen {
  height: 140px;
  border: 1px solid rgba(168, 85, 247, 0.28);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(14, 8, 24, 0.9), rgba(8, 20, 40, 0.75));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #94a3b8;
}
.meta { color: #94a3b8; font-size: 12px; margin-bottom: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.policy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.policy-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: #64748b;
}
.policy-grid label.full { grid-column: 1 / -1; }
code { color: #c4b5fd; font-size: 12px; }
.update-list { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.update-card {
  background: rgba(14, 8, 24, 0.62);
  border: 1px solid rgba(168, 85, 247, 0.28);
  border-radius: 14px;
  padding: 16px 18px;
}
.update-meta { display: flex; gap: 10px; align-items: center; color: #94a3b8; font-size: 12px; margin-bottom: 8px; }
.update-card h2 { font-size: 18px; margin-bottom: 8px; }
.update-card ul { margin-left: 18px; color: #cbd5e1; font-size: 14px; }
.update-card li { margin: 4px 0; }
.provider-row, .scene-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.provider-row .nav-item { border: 1px solid rgba(168, 85, 247, 0.28); }
.logs {
  max-height: 180px;
  overflow: auto;
  font-size: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
  color: #94a3b8;
}
.logs div { padding: 3px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.05); }
.proxy-stats { margin-top: 12px; font-size: 13px; color: #94a3b8; }
.proxy-terminal { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.proxy-terminal h2, .proxy-terminal .btn { font-family: "Segoe UI", Tahoma, sans-serif; }
.proxy-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.proxy-tab {
  background: rgba(2, 6, 23, 0.7);
  color: #94a3b8;
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.06em;
}
.proxy-tab.active {
  color: #e9d5ff;
  border-color: rgba(168, 85, 247, 0.7);
  background: rgba(124, 58, 237, 0.25);
}
.proxy-body { max-height: 420px; overflow: auto; margin-bottom: 12px; }
.deck-panel { margin-bottom: 14px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.chip {
  text-align: left;
  min-width: 150px;
  background: rgba(2, 6, 23, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}
.chip b { display: block; font-size: 14px; }
.chip span, .chip small { display: block; color: #94a3b8; font-size: 11px; margin-top: 2px; }
.chip.on { border-color: rgba(56, 189, 248, 0.85); background: rgba(56, 189, 248, 0.14); }
.advanced { margin: 8px 0 12px; color: #94a3b8; }
.advanced summary { cursor: pointer; color: #c4b5fd; margin-bottom: 8px; }
.flash {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
  color: #e0f2fe;
}
.suggest { margin-top: 18px; color: #94a3b8; font-size: 13px; font-family: "Segoe UI", sans-serif; }
.suggest a { color: #c4b5fd; }
.suggest ol, .suggest ul { margin-left: 18px; }
.suggest h3 { color: #e9d5ff; margin-bottom: 8px; font-size: 14px; }
.suggest li { margin: 6px 0 6px 18px; }
.alerts-full .item {
  padding: 10px 12px;
  border: 1px solid rgba(168, 85, 247, 0.22);
  border-radius: 10px;
  margin-bottom: 8px;
  background: rgba(2, 6, 23, 0.45);
  font-size: 13px;
}

@media (max-width: 960px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
  }
  .main-content {
    margin-left: 0;
    width: 100%;
  }
  .panel-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
}
