/* ========================================================================
   3xUI Shop — New UI design system
   Glassmorphism dark theme, layered over Tabler/Bootstrap.
   ======================================================================== */

:root {
  --bg: #0b1020;
  --bg-2: #0f1530;
  --panel: #121a36;
  --panel-2: #172146;
  --line: rgba(255, 255, 255, 0.06);
  --line-2: rgba(255, 255, 255, 0.10);
  --text: #e7ecff;
  --muted: #8a93b8;
  --tg: #2aabee;
  --tg-2: #229ed9;
  --grad-1: linear-gradient(135deg, #2aabee 0%, #7c5cff 100%);
  --grad-2: linear-gradient(135deg, #22d3ee 0%, #2aabee 100%);
  --grad-3: linear-gradient(135deg, #a78bfa 0%, #f472b6 100%);
  --grad-4: linear-gradient(135deg, #34d399 0%, #22d3ee 100%);
  --grad-5: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --ok: #34d399;
  --warn: #f59e0b;
  --err: #f87171;

  /* Bootstrap/Tabler overrides */
  --tblr-body-bg: var(--bg);
  --tblr-body-color: var(--text);
  --tblr-body-color-rgb: 231, 236, 255;
  --tblr-card-bg: rgba(255, 255, 255, 0.025);
  --tblr-card-border-color: var(--line);
  --tblr-border-color: var(--line);
  --tblr-secondary-color: var(--muted);
  --tblr-link-color: var(--tg);
  --tblr-primary: #2aabee;
  --tblr-primary-rgb: 42, 171, 238;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--muted);
  --bs-emphasis-color: var(--text);
  --bs-emphasis-color-rgb: 231, 236, 255;
  --bs-tertiary-bg: rgba(255, 255, 255, 0.03);
  --bs-tertiary-bg-rgb: 18, 26, 54;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(900px 600px at -10% -20%, rgba(42, 171, 238, 0.18), transparent 60%),
    radial-gradient(700px 500px at 110% 10%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(800px 600px at 50% 120%, rgba(244, 114, 182, 0.10), transparent 60%),
    var(--bg);
  min-height: 100vh;
}

body.layout-boxed > .container,
.layout-boxed { max-width: none !important; padding: 0 !important; }

/* ============== Layout: sidebar + main ============== */

.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  width: 260px;
  flex-shrink: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.app-sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 14px;
}
.app-sidebar .brand-mark {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--grad-1);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.25);
}
.app-sidebar .brand-title { font-weight: 700; font-size: 15px; line-height: 1.1; color: #fff; }
.app-sidebar .brand-sub { font-size: 11px; color: var(--muted); }

.app-sidebar .nav-section {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px 4px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #aab2d8;
  cursor: pointer;
  transition: background .2s, transform .2s, color .2s;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.04); color: #fff; transform: translateX(2px); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(42, 171, 238, 0.18), rgba(124, 92, 255, 0.18));
  color: #fff;
  border: 1px solid rgba(42, 171, 238, 0.25);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--grad-1);
}
.nav-item .icon { width: 18px; height: 18px; stroke-width: 1.8; flex-shrink: 0; }
.nav-item .nav-tag { margin-left: auto; font-size: 11px; color: var(--muted); }

.app-sidebar .sidebar-foot {
  margin-top: auto;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
}

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(11, 16, 32, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.app-topbar .topbar-title-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.app-topbar .topbar-title { font-size: 18px; font-weight: 700; color: #fff; }
.app-topbar .topbar-title small { color: var(--muted); font-weight: 400; font-size: 13px; }

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

@media (max-width: 991.98px) {
  .app-sidebar { display: none; }
  .app-content { padding: 16px; }
  .app-topbar { padding: 10px 16px; }
}

/* ============== Glass surfaces & cards ============== */

.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  border-radius: 16px;
}
.glass-2 {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line-2);
  border-radius: 16px;
}

/* Tabler card override */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)) !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  color: var(--text) !important;
  box-shadow: 0 8px 24px -16px rgba(0, 0, 0, 0.5);
}
.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--line) !important;
  color: #fff;
}
.card-title { color: #fff; font-weight: 600; }
.card-body { color: var(--text); }
.card.glass { background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)) !important; }

/* ============== KPI tiles ============== */

.kpi {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  transition: transform .2s;
}
.kpi:hover { transform: translateY(-2px); }
.kpi::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(42, 171, 238, 0.25), transparent 40%);
  pointer-events: none;
  mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 1px;
}
.kpi-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.kpi-label { font-size: 12px; color: var(--muted); margin-top: 12px; }
.kpi-value { font-size: 28px; font-weight: 800; margin-top: 4px; line-height: 1.1; }
.kpi-value small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.sparkline-wrap { height: 40px; width: 100%; position: relative; margin-top: 12px; }
.sparkline { position: absolute; inset: 0; }

/* ============== Chips ============== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.chip-ok   { background: rgba(52, 211, 153, 0.12); color: #6ee7b7; border: 1px solid rgba(52, 211, 153, 0.25); }
.chip-warn { background: rgba(245, 158, 11, 0.12); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.25); }
.chip-err  { background: rgba(248, 113, 113, 0.12); color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.25); }
.chip-tg   { background: rgba(42, 171, 238, 0.12); color: #7dd3fc; border: 1px solid rgba(42, 171, 238, 0.3); }

/* ============== Buttons (override Tabler/Bootstrap) ============== */

.btn {
  border-radius: 12px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  transition: transform .2s, box-shadow .2s, background .2s !important;
  border: 1px solid transparent !important;
}
.btn-primary, .button-primary {
  background: var(--grad-1) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 8px 24px -8px rgba(42, 171, 238, 0.55) !important;
}
.btn-primary:hover, .button-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px -8px rgba(42, 171, 238, 0.65) !important;
}
.btn-outline-primary {
  background: transparent !important;
  color: #7dd3fc !important;
  border: 1px solid rgba(42, 171, 238, 0.4) !important;
}
.btn-outline-primary:hover {
  background: rgba(42, 171, 238, 0.1) !important;
  color: #fff !important;
}
.btn-outline-secondary, .btn-ghost {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #cdd4ff !important;
  border: 1px solid var(--line-2) !important;
}
.btn-outline-secondary:hover, .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}
.btn-success { background: var(--grad-4) !important; color: #fff !important; border: none !important; }
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(52, 211, 153, 0.45) !important; }
.btn-danger { background: var(--grad-5) !important; color: #fff !important; border: none !important; }
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(239, 68, 68, 0.45) !important; }
.btn-secondary { background: rgba(255, 255, 255, 0.06) !important; color: var(--muted) !important; border: 1px solid var(--line-2) !important; }

.btn-glass {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #cdd4ff !important;
  border: 1px solid var(--line-2) !important;
  backdrop-filter: blur(8px);
}

/* ============== Forms ============== */

.form-control, .form-select {
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--text) !important;
  border: 1px solid var(--line-2) !important;
  border-radius: 10px !important;
}
.form-control::placeholder { color: var(--muted) !important; }
.form-control:focus, .form-select:focus {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--tg) !important;
  box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.18) !important;
  color: #fff !important;
}
.form-label, label { color: var(--text); font-weight: 500; }
.form-check-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-2);
}
.form-check-input:checked {
  background: var(--grad-1);
  border: none;
}

/* ============== Tables ============== */

.table {
  --tblr-table-bg: transparent !important;
  --tblr-table-color: var(--text) !important;
  --tblr-table-border-color: var(--line) !important;
  --tblr-table-striped-color: var(--text) !important;
  --tblr-table-striped-bg: rgba(255, 255, 255, 0.02) !important;
  --tblr-table-hover-color: #fff !important;
  --tblr-table-hover-bg: rgba(255, 255, 255, 0.04) !important;
  --bs-table-color: var(--text) !important;
  --bs-table-bg: transparent !important;
  --bs-table-border-color: var(--line) !important;
  color: var(--text) !important;
}
.table > :not(caption) > * > * {
  border-bottom-color: var(--line) !important;
  color: var(--text);
}
.table thead th, .table-head th {
  font-size: 11px;
  letter-spacing: 0.6px;
  color: var(--muted) !important;
  text-transform: uppercase;
  font-weight: 600;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--line) !important;
}
.table tbody td {
  padding: 14px;
  font-size: 13px;
  color: #cdd4ff;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}
.table tbody tr:hover { background: rgba(255, 255, 255, 0.025) !important; }

/* ============== Pagination ============== */

.pagination .page-link {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--line-2) !important;
  color: var(--text) !important;
  border-radius: 8px !important;
  margin: 0 2px;
}
.pagination .page-item.active .page-link {
  background: var(--grad-1) !important;
  color: #fff !important;
  border: none !important;
}
.pagination .page-item.disabled .page-link { color: var(--muted) !important; opacity: 0.5; }

/* ============== Modals ============== */

.modal-content {
  background: linear-gradient(180deg, #131a3a, #0f1530) !important;
  border: 1px solid var(--line-2) !important;
  border-radius: 18px !important;
  color: var(--text) !important;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
}
.modal-header, .modal-footer { border-color: var(--line) !important; }
.modal-title { color: #fff; font-weight: 600; }
.btn-close { filter: invert(1) opacity(0.8); }

/* ============== Toasts ============== */

.toast {
  background: linear-gradient(180deg, #1a2452, #131a3a) !important;
  border: 1px solid var(--line-2) !important;
  color: var(--text) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(10px);
}
.text-bg-success { background: linear-gradient(135deg, #047857, #065f46) !important; border-color: rgba(52, 211, 153, 0.3) !important; }
.text-bg-danger  { background: linear-gradient(135deg, #b91c1c, #7f1d1d) !important; border-color: rgba(248, 113, 113, 0.3) !important; }
.text-bg-warning { background: linear-gradient(135deg, #b45309, #78350f) !important; border-color: rgba(245, 158, 11, 0.3) !important; }

/* ============== Misc utilities ============== */

.gtxt { background: var(--grad-1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-1 { background: var(--grad-1); }
.grad-2 { background: var(--grad-2); }
.grad-3 { background: var(--grad-3); }
.grad-4 { background: var(--grad-4); }
.grad-5 { background: var(--grad-5); }
.ring-tg { box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.25); }

.divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent); margin: 16px 0; }

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); margin-right: 6px; }
.status-dot.bg-green, .bg-green { background: var(--ok) !important; }
.status-dot.bg-red, .bg-red { background: var(--err) !important; }
.status-dot-animated { animation: pulse-dot 1.6s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { box-shadow: 0 0 0 0 currentColor; } 50% { box-shadow: 0 0 0 6px transparent; } }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.seg {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 3px;
}
.seg button {
  padding: 6px 12px;
  border-radius: 9px;
  color: #aab2d8;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.seg button:hover { color: #fff; }
.seg button.act, .seg button.active {
  background: rgba(42, 171, 238, 0.18);
  color: #fff;
  border: 1px solid rgba(42, 171, 238, 0.3);
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08) !important;
  overflow: hidden;
}
.progress-bar { border-radius: inherit; background: var(--grad-1) !important; }

/* Text colors / Tabler overrides */
.text-secondary, .text-muted { color: var(--muted) !important; }
.subheader { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.text-success { color: var(--ok) !important; }
.text-danger  { color: var(--err) !important; }
.text-warning { color: var(--warn) !important; }
.text-white   { color: #fff !important; }

.h1, .h2, .h3, h1, h2, h3 { color: #fff; }
.page-title { color: #fff; font-weight: 700; }

/* Badge override */
.badge {
  border-radius: 999px;
  font-weight: 600;
  font-size: 11px;
  padding: 4px 10px;
}
.bg-blue-lt   { background: rgba(42, 171, 238, 0.18) !important; color: #7dd3fc !important; }
.bg-green-lt  { background: rgba(52, 211, 153, 0.18) !important; color: #6ee7b7 !important; }
.bg-red-lt    { background: rgba(248, 113, 113, 0.18) !important; color: #fca5a5 !important; }
.bg-yellow-lt { background: rgba(245, 158, 11, 0.18) !important; color: #fcd34d !important; }
.bg-purple-lt { background: rgba(167, 139, 250, 0.18) !important; color: #c4b5fd !important; }

/* List groups & nav-tabs */
.list-group-item {
  background: transparent !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}
.nav-tabs { border-bottom: 1px solid var(--line) !important; }
.nav-tabs .nav-link {
  color: var(--muted) !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  background: transparent !important;
  border-radius: 0 !important;
  padding: 10px 14px !important;
  font-weight: 500;
}
.nav-tabs .nav-link.active {
  color: #fff !important;
  border-bottom-color: var(--tg) !important;
  background: transparent !important;
}

/* Alerts */
.alert {
  border-radius: 12px !important;
  border: 1px solid var(--line-2) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)) !important;
  color: var(--text) !important;
}
.alert-danger  { border-color: rgba(248, 113, 113, 0.4) !important; background: rgba(248, 113, 113, 0.08) !important; color: #fca5a5 !important; }
.alert-success { border-color: rgba(52, 211, 153, 0.4) !important; background: rgba(52, 211, 153, 0.08) !important; color: #6ee7b7 !important; }
.alert-warning { border-color: rgba(245, 158, 11, 0.4) !important; background: rgba(245, 158, 11, 0.08) !important; color: #fcd34d !important; }
.alert-info    { border-color: rgba(42, 171, 238, 0.4) !important; background: rgba(42, 171, 238, 0.08) !important; color: #7dd3fc !important; }

/* Dropdowns */
.dropdown-menu {
  background: linear-gradient(180deg, #131a3a, #0f1530) !important;
  border: 1px solid var(--line-2) !important;
  border-radius: 12px !important;
  color: var(--text) !important;
  box-shadow: 0 16px 48px -12px rgba(0, 0, 0, 0.7);
  padding: 6px !important;
  min-width: 220px;
}
.dropdown-item {
  color: var(--text) !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  display: flex !important;
  align-items: center !important;
  background: transparent !important;
  border: none !important;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.dropdown-item:hover, .dropdown-item:focus { background: rgba(255, 255, 255, 0.06) !important; color: #fff !important; transform: translateX(2px); }
.dropdown-divider { border-color: var(--line) !important; margin: 6px 0 !important; opacity: 1 !important; }

/* Compact row-action toggle */
.user-actions .dd-toggle {
  width: 32px; height: 32px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px !important;
  color: var(--muted) !important;
}
.user-actions .dd-toggle:hover { color: #fff !important; background: rgba(255,255,255,0.08) !important; }
.user-actions .dd-toggle::after { display: none !important; }
.user-actions .dropdown-item form { width: 100%; }

/* Code & pre */
code, pre {
  background: rgba(0, 0, 0, 0.3);
  color: #cdd4ff;
  border-radius: 6px;
  padding: 2px 6px;
}
pre { padding: 12px; border: 1px solid var(--line); }

/* ============== Page-level animations ============== */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.app-content > * { animation: fade-up .35s ease-out both; }
.app-content > *:nth-child(2) { animation-delay: .05s; }
.app-content > *:nth-child(3) { animation-delay: .1s; }
.app-content > *:nth-child(4) { animation-delay: .15s; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============== Sidebar burger (mobile) ============== */

.mobile-burger {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-2);
  align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text);
}
@media (max-width: 991.98px) {
  .mobile-burger { display: inline-flex; }
}

.sidebar-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 40;
}
.sidebar-drawer-backdrop.open { display: block; }
@media (max-width: 991.98px) {
  .app-sidebar.drawer-open {
    display: flex;
    position: fixed;
    left: 0; top: 0;
    z-index: 50;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, #131a3a, #0f1530);
  }
}

/* ============== Topbar controls ============== */

.bot-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-2);
  font-size: 12px;
}
.bot-status.running { color: #6ee7b7; border-color: rgba(52, 211, 153, 0.25); }
.bot-status.stopped { color: var(--muted); }

/* ============== Soft-select (preserved) ============== */
.soft-select { position: relative; }
.soft-select-toggle {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.soft-select-menu {
  display: none;
  background: linear-gradient(180deg, #131a3a, #0f1530);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 12px 40px -10px rgba(0, 0, 0, 0.6);
}
.soft-select.open .soft-select-menu { display: block; }
.soft-select-item {
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
}
.soft-select-item:hover, .soft-select-item.is-active { background: rgba(42, 171, 238, 0.12); color: #fff; }
.select-soft { display: none !important; }

/* ============== Login page ============== */

body.login-page {
  background:
    radial-gradient(900px 600px at -10% -20%, rgba(42, 171, 238, 0.22), transparent 60%),
    radial-gradient(700px 500px at 110% 10%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(800px 600px at 50% 120%, rgba(244, 114, 182, 0.16), transparent 60%),
    var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line-2);
  border-radius: 24px;
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  animation: fade-up .5s ease-out;
}
.login-container h1 {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 20px;
  text-align: center;
}
.login-container .login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}
.login-container .login-brand-mark {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: var(--grad-1);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.25);
}
.login-container .form-group { margin-bottom: 14px; }
.login-container input[type="text"],
.login-container input[type="password"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
}
.login-container input[type="text"]:focus,
.login-container input[type="password"]:focus {
  outline: none;
  border-color: var(--tg);
  box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.18);
}
.login-container label { color: var(--muted); font-size: 12px; font-weight: 500; margin-bottom: 4px; display: block; }
.login-container .password-wrapper { position: relative; }
.login-container .toggle-password {
  position: absolute;
  right: 10px; top: 32px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
}
.login-container .flash {
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 13px;
}
.login-container .flash-danger  { background: rgba(248, 113, 113, 0.12); color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.3); }
.login-container .flash-success { background: rgba(52, 211, 153, 0.12); color: #6ee7b7; border: 1px solid rgba(52, 211, 153, 0.3); }
.login-container .flash-warning { background: rgba(245, 158, 11, 0.12); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }
.login-container .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.login-container .button-primary {
  background: var(--grad-1);
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(42, 171, 238, 0.55);
}
.login-container .button-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 30px -8px rgba(42, 171, 238, 0.65); }

/* Hide legacy canvas (replaced by CSS blobs) */
canvas#scene { display: none !important; }

/* Animated background blobs — GPU-friendly (transform only) */
.login-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.login-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  will-change: transform;
  animation: blob-float 22s ease-in-out infinite;
}
.login-blob.b1 {
  width: 520px; height: 520px;
  left: -120px; top: -140px;
  background: radial-gradient(circle, #2aabee 0%, transparent 70%);
}
.login-blob.b2 {
  width: 460px; height: 460px;
  right: -120px; top: 10%;
  background: radial-gradient(circle, #7c5cff 0%, transparent 70%);
  animation-delay: -7s;
  animation-duration: 28s;
}
.login-blob.b3 {
  width: 600px; height: 600px;
  left: 30%; bottom: -240px;
  background: radial-gradient(circle, #f472b6 0%, transparent 70%);
  opacity: 0.4;
  animation-delay: -14s;
  animation-duration: 34s;
}
@keyframes blob-float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  25%      { transform: translate3d(40px, -30px, 0) scale(1.08); }
  50%      { transform: translate3d(-30px, 40px, 0) scale(0.95); }
  75%      { transform: translate3d(20px, 20px, 0) scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .login-blob { animation: none !important; }
}

/* ============== Logs page (terminal style) ============== */
.terminal-log {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  font-family: 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  color: #cdd4ff;
  max-height: 70vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Open tickets badge in sidebar */
.open-tickets-badge { display: inline-flex; align-items: center; }

/* Hide legacy header */
.main-header { display: none !important; }
.main-footer { display: none !important; }

/* Burger / brand-edit / theme-toggle compat — hidden by default in new shell */
.bm { display: none; }

/* Brand-link visual when used */
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.brand-link img { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; }

/* Chart container wrapping */
.chart { position: relative; }

/* Spinner aurora (used in speedtest modal) */
.spinner-aurora {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #2aabee, #7c5cff, #f472b6, #34d399, #2aabee);
  animation: spin 1.2s linear infinite;
  mask: radial-gradient(circle 14px at center, transparent 98%, black 100%);
  -webkit-mask: radial-gradient(circle 14px at center, transparent 98%, black 100%);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Donut canvas overlay */
.donut-wrap { position: relative; display: inline-block; }
.donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  pointer-events: none;
}

/* Form inputs in dark contexts (Tabler form-check) */
.form-check-label { color: var(--text); }

/* Card compact */
.card-compact .card-body { padding: 12px 14px; }

/* Tiny text helper */
.tiny { font-size: 11px; color: var(--muted); }

/* ==========================================================================
   Section header pattern (eyebrow + title + meta)
   ========================================================================== */

.section-head { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.section-head .eyebrow { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.section-head .h-title { font-size: 22px; font-weight: 800; color: #fff; margin: 4px 0 0; line-height: 1.15; }
.section-head .h-meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.section-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Tabler page-header → reskin to match section-head */
.page-header { margin: 0 0 16px !important; padding: 0 !important; border: none !important; }
.page-header .page-title { color: #fff !important; font-size: 22px !important; font-weight: 800 !important; }
.page-header .page-pretitle, .page-pretitle { font-size: 11px !important; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted) !important; font-weight: 600; }

/* ==========================================================================
   Tabler residual cleanup — remove Bootstrap's lighter container, reset spacing
   ========================================================================== */

body.layout-boxed { padding: 0 !important; }
.container, .container-fluid, .container-xl, .container-lg { max-width: none !important; padding: 0 !important; margin: 0 !important; }
.page, .page-wrapper { background: transparent !important; padding: 0 !important; }
.row { --bs-gutter-x: 12px; --bs-gutter-y: 12px; }

/* Card harmonization */
.card { backdrop-filter: blur(14px); }
.card-body, .card-footer { background: transparent !important; }
.card-table { background: transparent !important; }
.card-md, .card-lg { border-radius: 16px !important; }
.card .card-header { padding: 14px 18px; }
.card .card-body { padding: 16px 18px; }

/* Tabler subheader styling */
.subheader, .form-hint { color: var(--muted) !important; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }

/* Tabler text utilities re-color */
.text-bg-secondary { background: rgba(255,255,255,0.06) !important; color: var(--text) !important; }
.text-bg-light, .bg-light { background: rgba(255,255,255,0.04) !important; color: var(--text) !important; }
.bg-white, .bg-body { background: transparent !important; }
hr { border-color: var(--line) !important; opacity: 1 !important; }

/* Input groups */
.input-group-text {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid var(--line-2) !important;
  color: var(--muted) !important;
}

/* Tabler form-switch — make it match template's .toggle */
.form-switch .form-check-input {
  background-color: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.12) !important;
  width: 38px !important; height: 22px !important;
  background-image: linear-gradient(180deg,#fff,#fff) !important;
  background-repeat: no-repeat;
  background-position: 2px center !important;
  background-size: 18px 18px !important;
  border-radius: 999px !important;
  transition: background-color .2s, background-position .2s !important;
}
.form-switch .form-check-input:checked {
  background-color: transparent !important;
  background-image: linear-gradient(135deg,#2aabee,#7c5cff), linear-gradient(180deg,#fff,#fff) !important;
  background-size: 100% 100%, 18px 18px !important;
  background-position: 0 0, 18px center !important;
  background-repeat: no-repeat, no-repeat;
  border-color: transparent !important;
}
.form-switch .form-check-input:focus { box-shadow: 0 0 0 3px rgba(42,171,238,0.18) !important; }

/* ==========================================================================
   Custom .toggle (used outside Tabler)
   ========================================================================== */

.toggle {
  width: 38px; height: 22px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background .2s;
  border: none;
  flex-shrink: 0;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: left .2s;
}
.toggle.on { background: var(--grad-1); }
.toggle.on::after { left: 18px; }

/* ==========================================================================
   Tariff cards
   ========================================================================== */

.tariff {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  transition: transform .2s, box-shadow .2s;
}
.tariff:hover { transform: translateY(-2px); box-shadow: 0 14px 36px -18px rgba(0,0,0,0.5); }
.tariff .blob {
  position: absolute;
  width: 180px; height: 180px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  top: -50px; right: -50px;
  pointer-events: none;
}
.tariff.popular { border: 1px solid rgba(42,171,238,0.45); box-shadow: 0 20px 60px -20px rgba(42,171,238,0.45); }
.tariff .price { display: flex; align-items: baseline; gap: 6px; }
.tariff .price b { font-size: 28px; font-weight: 800; color: #fff; }
.tariff .price .old { font-size: 13px; color: var(--muted); text-decoration: line-through; }

/* Country chip */
.country {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-2);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  color: #cdd4ff;
}

/* ==========================================================================
   Chat bubbles (used on ticket page — borrowed from template's tg)
   ========================================================================== */

.chat-thread { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  word-wrap: break-word;
}
.bubble .meta { font-size: 10px; color: var(--muted); margin-top: 4px; }
.bub-bot {
  align-self: flex-start;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  color: #dbe7f5;
  border: 1px solid var(--line-2);
  border-bottom-left-radius: 4px;
}
.bub-me {
  align-self: flex-end;
  background: linear-gradient(135deg, #2aabee, #7c5cff);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 8px 24px -12px rgba(42,171,238,0.6);
}

/* Open tickets badge inline */
.open-tickets-badge .badge { display: inline-flex; align-items: center; gap: 4px; }

/* ==========================================================================
   Avatars (auto-color by class)
   ========================================================================== */

.avatar.grad-1, .avatar.grad-2, .avatar.grad-3, .avatar.grad-4, .avatar.grad-5 { color: #fff; }
.user-cell { display: flex; align-items: center; gap: 12px; }
.user-cell .meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-cell .meta .name { font-weight: 600; color: #fff; font-size: 13px; }
.user-cell .meta .sub  { font-size: 11px; color: var(--muted); }

/* ==========================================================================
   Terminal-style log viewer
   ========================================================================== */

.term {
  background: rgba(0,0,0,0.45);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  font-family: 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  color: #cdd4ff;
  max-height: 72vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}
.term .lvl-INFO    { color: #6ee7b7; }
.term .lvl-WARNING { color: #fcd34d; }
.term .lvl-ERROR   { color: #fca5a5; }
.term .ts          { color: var(--muted); }

/* ==========================================================================
   Cohort heatmap helper
   ========================================================================== */

.cohort-cell {
  border-radius: 6px;
  padding: 8px 4px;
  font-weight: 700;
  font-size: 11px;
}

/* ==========================================================================
   Server cards (template's glass-2 with flag + progress)
   ========================================================================== */

.server-card { padding: 12px; border-radius: 14px; }
.server-flag {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff;
}

/* ==========================================================================
   Misc inline edit inputs (template "bare" inputs)
   ========================================================================== */

.inp {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 13px;
  transition: border-color .2s, box-shadow .2s;
}
.inp:focus { outline: none; border-color: var(--tg); box-shadow: 0 0 0 3px rgba(42,171,238,0.18); }
.inp.mono { font-family: 'JetBrains Mono', Menlo, Consolas, monospace; }

/* ==========================================================================
   Empty state
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}
.empty-state .icn {
  width: 56px; height: 56px;
  border-radius: 16px;
  margin: 0 auto 12px;
  background: rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: center;
  color: #cdd4ff;
}

/* ==========================================================================
   Search input with leading icon
   ========================================================================== */

.search-input { position: relative; }
.search-input > svg, .search-input > .ti {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-input > input { padding-left: 36px !important; }

/* Override Tabler list-group hover */
.list-group-item-action:hover { background: rgba(255,255,255,0.04) !important; color: #fff !important; }

/* Soft scrollbar everywhere */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Tabler navigation residue */
.navigation, .main-header, .main-footer, .bm, header.main-header { display: none !important; }

/* Strip Bootstrap default focus rings, use ours */
button:focus, .btn:focus { outline: none !important; box-shadow: 0 0 0 3px rgba(42,171,238,0.18) !important; }

/* Flash messages (login standalone) */
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; font-size: 13px; }
.flash-danger  { background: rgba(248,113,113,0.12); color: #fca5a5; border: 1px solid rgba(248,113,113,0.3); }
.flash-success { background: rgba(52,211,153,0.12); color: #6ee7b7; border: 1px solid rgba(52,211,153,0.3); }
.flash-warning { background: rgba(245,158,11,0.12); color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }
.flash-info    { background: rgba(42,171,238,0.12); color: #7dd3fc; border: 1px solid rgba(42,171,238,0.3); }
