/* ═══════════════════════════════════════════════════════════
   Nexar Client Panel PRO — Design system
   ═══════════════════════════════════════════════════════════ */

body.portal-client {
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.12);
  --accent-glow: rgba(99, 102, 241, 0.22);
  --cx-radius: 14px;
  --cx-radius-sm: 10px;
  --cx-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.12);
  --cx-success: #22c55e;
  --cx-warn: #f59e0b;
  --cx-danger: #ef4444;
}

/* ── Layout ── */
body.portal-client .page {
  max-width: 880px;
  padding: 20px 20px 100px;
}
body.portal-client .page-dash {
  max-width: 1080px;
}
body.portal-client .page-wide {
  max-width: 1160px;
}
body.portal-client .cx-main {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.04) 0%, transparent 280px);
}

/* ── Sidebar ── */
body.portal-client .cx-sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--border);
}
body.portal-client .cx-sidebar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
}
body.portal-client .cx-logo {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 4px 14px var(--accent-glow);
}
body.portal-client .cx-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
body.portal-client .cx-brand-text .s-tag {
  font-size: 0.62rem;
  border: none;
  padding: 0;
  color: var(--text-3);
}
body.portal-client .cx-nav-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin: 14px 12px 6px;
}
body.portal-client .cx-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--cx-radius-sm);
  padding: 10px 12px !important;
  font-size: 0.84rem;
}
body.portal-client .cx-nav-link span { flex: 1; }
body.portal-client .cx-nav-ext {
  font-size: 0.75rem;
  opacity: 0.4;
}
body.portal-client .cx-sidebar-foot {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
body.portal-client .cx-sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 10px;
}
body.portal-client .cx-sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}
body.portal-client .cx-sidebar-avatar-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  color: var(--text-3);
}
body.portal-client .cx-sidebar-username {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Topbar ── */
body.portal-client .cx-topbar {
  backdrop-filter: blur(12px);
  background: rgba(var(--bg-1-rgb, 15, 15, 20), 0.85) !important;
}
body.portal-client .cx-topbar-profile {
  border-radius: var(--cx-radius-sm);
}

/* ── Breadcrumbs ── */
.cx-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  font-size: 0.76rem;
}
.cx-breadcrumb li {
  display: flex;
  align-items: center;
  color: var(--text-3);
}
.cx-breadcrumb li:not(:last-child)::after {
  content: '/';
  margin: 0 8px;
  opacity: 0.4;
}
.cx-breadcrumb a {
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.15s;
}
.cx-breadcrumb a:hover { color: var(--accent); }
.cx-breadcrumb li:last-child span {
  color: var(--text-0);
  font-weight: 600;
}

/* ── Page header ── */
.cx-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.cx-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 4px;
}
.cx-page-title, .cx-hero-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-0);
  margin: 0 0 6px;
  line-height: 1.2;
}
.cx-page-sub, .cx-hero-sub {
  font-size: 0.86rem;
  color: var(--text-2);
  margin: 0;
}

/* ── Hero ── */
.cx-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  padding: 20px 22px;
  margin-bottom: 16px;
  border-radius: var(--cx-radius);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--bg-2) 0%, rgba(99, 102, 241, 0.06) 100%);
  box-shadow: var(--cx-shadow);
}
.cx-hero-body { flex: 1; min-width: 180px; }
.cx-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.cx-hero-expiry {
  font-size: 0.76rem;
  color: var(--text-3);
}
.cx-hero-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  color: var(--text-3);
  font-size: 1.6rem;
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.cx-hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cx-hero-avatar.is-live {
  border-color: var(--cx-success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}
.cx-hero-avatar-square {
  border-radius: 16px;
}
.cx-hero-avatar-square img { border-radius: 14px; }
.cx-hero-compact {
  padding: 16px 20px;
  margin-bottom: 12px;
}
.cx-hero-compact .cx-hero-title {
  font-size: 1.25rem;
}
.cx-dl-flush {
  margin-top: 0;
}
.cx-id-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.cx-id-row code {
  font-size: 0.76rem;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
}

/* ── Toolbar & buttons ── */
.cx-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.cx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--cx-radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.cx-btn:hover { transform: translateY(-1px); }
.cx-btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.cx-btn-primary:hover { background: var(--accent-hover); }
.cx-btn-success {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.35);
}
.cx-btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-1);
}
.cx-btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.cx-btn-ghost {
  background: var(--bg-3);
  border-color: var(--border);
  color: var(--text-1);
}
.cx-btn-warn {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}
.cx-btn-sm { padding: 6px 12px; font-size: 0.76rem; }
.cx-btn-xs { padding: 4px 8px; font-size: 0.72rem; }

/* ── Sticky nav ── */
.cx-sticky-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  position: sticky;
  top: 56px;
  z-index: 45;
  padding: 6px;
  margin-bottom: 16px;
  border-radius: var(--cx-radius);
  border: 1px solid var(--border);
  background: rgba(var(--bg-1-rgb, 15, 15, 20), 0.94);
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.cx-sticky-nav-top {
  margin-top: 0;
  margin-bottom: 18px;
}
.cx-sticky-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.cx-sticky-nav a:hover { color: var(--text-0); background: var(--bg-3); }
.cx-sticky-nav a.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* ── Panel tabs ── */
.cx-panel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  padding: 5px;
  border-radius: var(--cx-radius);
  border: 1px solid var(--border);
  background: var(--bg-2);
}
.cx-panel-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.cx-panel-tab:hover { color: var(--text-0); }
.cx-panel-tab.is-active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.cx-panel { animation: cxFadeIn 0.2s ease; }
@keyframes cxFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ── Cards ── */
.cx-card {
  margin-bottom: 16px;
  border-radius: var(--cx-radius);
  border: 1px solid var(--border);
  background: var(--bg-2);
  box-shadow: var(--cx-shadow);
  overflow: hidden;
  scroll-margin-top: 100px;
}
.cx-card-highlight {
  border-color: rgba(99, 102, 241, 0.35);
  background: linear-gradient(135deg, var(--bg-2), rgba(99, 102, 241, 0.08));
}
.cx-card-head {
  padding: 18px 20px 0;
}
.cx-card-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-0);
  margin: 0 0 4px;
}
.cx-card-head h3 i { color: var(--accent); }
.cx-card-head p {
  font-size: 0.78rem;
  color: var(--text-3);
  margin: 0;
}
.cx-card-body {
  padding: 16px 20px 20px;
}
.cx-card-body-flush {
  padding-top: 0;
}
.cx-card-body-flush .cx-user-search {
  padding-top: 4px;
}

/* ── Alerts ── */
.cx-alert {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: var(--cx-radius-sm);
  border: 1px solid var(--border);
  position: relative;
}
.cx-alert-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.cx-alert-title {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 4px;
}
.cx-alert-text {
  font-size: 0.8rem;
  margin: 0 0 8px;
  opacity: 0.9;
  line-height: 1.45;
}
.cx-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.cx-alert-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cx-alert-link:hover { text-decoration: underline; }
.cx-alert-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  padding: 4px;
  font-size: 1rem;
}
.cx-alert-close:hover { opacity: 1; }
.cx-alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.cx-alert-warn {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.28);
  color: #fcd34d;
}
.cx-alert-info {
  background: var(--accent-soft);
  border-color: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}
.cx-alert-muted {
  background: var(--bg-3);
  color: var(--text-2);
}
.cx-alert-details {
  margin-top: 8px;
  font-size: 0.76rem;
}
.cx-alert-details summary {
  cursor: pointer;
  font-weight: 600;
}

/* ── Dashboard ── */
.cx-stat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cx-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.cx-stat-pill-success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.25);
  color: #4ade80;
}
.cx-stat-pill-warn {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}
.cx-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: cxPulse 2s infinite;
}
@keyframes cxPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.cx-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.cx-kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--cx-radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
}
.cx-kpi i {
  font-size: 1.3rem;
  color: var(--text-3);
}
.cx-kpi strong {
  display: block;
  font-size: 1.2rem;
  color: var(--text-0);
  line-height: 1.1;
}
.cx-kpi span {
  font-size: 0.72rem;
  color: var(--text-3);
}
.cx-kpi-green i, .cx-kpi-green strong { color: var(--cx-success); }
.cx-kpi-accent i { color: var(--accent); }
.cx-kpi-accent strong { color: var(--accent); }

.cx-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.cx-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cx-filter {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.cx-filter.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.cx-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: var(--cx-radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
  min-width: 200px;
  flex: 1;
  max-width: 280px;
}
.cx-search-wrap i { color: var(--text-3); }
.cx-search {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 0;
  font-size: 0.82rem;
  color: var(--text-0);
  outline: none;
  font-family: inherit;
}

.cx-bot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.cx-bot-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--cx-radius);
  border: 1px solid var(--border);
  background: var(--bg-2);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: var(--cx-shadow);
}
.cx-bot-card:hover {
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}
.cx-bot-card.is-online {
  border-color: rgba(34, 197, 94, 0.25);
}
.cx-bot-card.is-expired {
  opacity: 0.75;
  filter: grayscale(0.3);
}
.cx-bot-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.cx-bot-avatar {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  color: var(--text-3);
  font-size: 1.4rem;
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.cx-bot-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cx-bot-avatar.is-live { border-color: var(--cx-success); }
.cx-bot-card-info {
  flex: 1;
  min-width: 0;
}
.cx-bot-card-info strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cx-bot-handle {
  font-size: 0.72rem;
  color: var(--text-3);
}
.cx-bot-type {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cx-server-card-static {
  cursor: default;
  opacity: 0.95;
}
.cx-server-card-static .cx-server-card-arrow {
  display: none;
}
  display: inline-block;
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cx-bot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 0.72rem;
  color: var(--text-2);
}
.cx-bot-chips i { margin-right: 2px; }
.cx-chip-green { color: var(--cx-success); }
.cx-chip-accent { color: var(--accent); }
.cx-bot-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
}
.cx-bot-expiry { color: var(--text-3); }
.cx-bot-go {
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 2px;
}
.cx-bot-card-warn {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  font-size: 0.72rem;
  color: #f87171;
}

/* ── Empty states ── */
.cx-empty {
  text-align: center;
  padding: 48px 24px;
  border-radius: var(--cx-radius);
  border: 1px dashed var(--border);
  background: var(--bg-2);
}
.cx-empty-icon {
  font-size: 2.5rem;
  color: var(--text-3);
  margin-bottom: 12px;
}
.cx-empty h3 { margin: 0 0 8px; color: var(--text-0); }
.cx-empty p { color: var(--text-2); margin: 0 0 20px; }
.cx-empty-sm {
  padding: 28px 20px;
  text-align: center;
}
.cx-empty-sm i { font-size: 1.8rem; color: var(--text-3); display: block; margin-bottom: 8px; }
.cx-steps {
  text-align: left;
  max-width: 320px;
  margin: 0 auto 24px;
  padding: 0;
  list-style: none;
}
.cx-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.84rem;
  color: var(--text-2);
}
.cx-steps li span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Forms ── */
.cx-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--cx-radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text-0);
  font-size: 0.84rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cx-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.cx-input-short { max-width: 120px; }
.cx-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
}
.cx-field { margin-bottom: 16px; }
.cx-field-hint {
  font-size: 0.72rem;
  color: var(--text-3);
  margin: 0 0 8px;
}
.cx-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}
.cx-switch {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 16px;
}
.cx-switch input { display: none; }
.cx-switch-ui {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}
.cx-switch-ui::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.cx-switch input:checked + .cx-switch-ui {
  background: var(--accent);
  border-color: var(--accent);
}
.cx-switch input:checked + .cx-switch-ui::after {
  transform: translateX(18px);
}
.cx-switch-text strong {
  display: block;
  font-size: 0.84rem;
  color: var(--text-0);
}
.cx-switch-text small {
  font-size: 0.72rem;
  color: var(--text-3);
}

.cx-dl {
  margin: 16px 0 0;
  display: grid;
  gap: 0;
}
.cx-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}
.cx-dl > div:last-child { border-bottom: none; }
.cx-dl dt { color: var(--text-3); font-weight: 500; }
.cx-dl dd { color: var(--text-0); margin: 0; text-align: right; }

/* ── Server grid (bot detail) ── */
.cx-server-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cx-server-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--cx-radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-1);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.cx-server-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.cx-server-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  flex-shrink: 0;
}
.cx-server-card-icon img { width: 100%; height: 100%; object-fit: cover; }
.cx-server-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cx-server-card-body strong {
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cx-server-card-body > span {
  font-size: 0.74rem;
  color: var(--text-3);
}
.cx-server-card-stats {
  display: flex;
  gap: 10px;
  font-size: 0.72rem;
  font-style: normal;
  color: var(--accent);
}
.cx-server-card-arrow {
  color: var(--text-3);
  font-size: 1.2rem;
}

/* ── Module grid ── */
.cx-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.cx-module-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--cx-radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
}
.cx-module-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.cx-module-body h4 {
  margin: 0 0 4px;
  font-size: 0.82rem;
  color: var(--text-1);
}
.cx-module-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-0);
  margin: 0;
}
.cx-module-val.is-on { color: var(--cx-success); }
.cx-module-meta, .cx-module-hint {
  display: block;
  font-size: 0.68rem;
  color: var(--text-3);
  margin-top: 2px;
}

/* ── User search ── */
.cx-user-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cx-user-search-ac {
  flex: 1;
  min-width: 200px;
  position: relative;
}

/* ── Help grid ── */
.cx-help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.cx-help-grid article {
  padding: 14px;
  border-radius: var(--cx-radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-1);
}
.cx-help-grid code {
  display: block;
  font-size: 0.88rem;
  color: var(--accent);
  margin-bottom: 6px;
}
.cx-help-grid p {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-3);
}

.cx-footnote {
  margin: 12px 0 0;
  font-size: 0.72rem;
  color: var(--text-3);
}
.cx-footnote a { color: var(--accent); }

/* ── Tables ── */
.cx-table-wrap {
  overflow-x: auto;
  border-radius: var(--cx-radius-sm);
  border: 1px solid var(--border);
}
.cx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.cx-table th, .cx-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.cx-table th.right, .cx-table td.right { text-align: right; }
.cx-table thead th {
  background: var(--bg-3);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
}
.cx-table tbody tr:last-child td { border-bottom: none; }

.cx-billing-bots {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cx-billing-bot {
  padding: 14px;
  border-radius: var(--cx-radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-1);
}
.cx-billing-bot-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.cx-details { margin-top: 16px; font-size: 0.82rem; }
.cx-plan-list { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); }

/* ── Bottom nav (mobile) ── */
.cx-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(var(--bg-1-rgb, 15, 15, 20), 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  justify-content: space-around;
  gap: 4px;
}
.cx-bottom-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-3);
  text-decoration: none;
  border-radius: 8px;
  min-width: 64px;
}
.cx-bottom-link i { font-size: 1.2rem; }
.cx-bottom-link.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ── Toast ── */
.cx-toast {
  border-radius: var(--cx-radius-sm) !important;
  box-shadow: var(--cx-shadow);
}

/* ── Modal ── */
.cx-modal {
  border-radius: var(--cx-radius) !important;
}

/* ── Leaderboard in new style ── */
.cx-leaderboard { padding: 4px 0; }
.cx-leaderboard-head {
  display: flex;
  justify-content: flex-end;
  padding: 0 20px 12px;
}
.cx-leaderboard-tabs { display: flex; gap: 6px; }
.cx-lb-panel { animation: cxFadeIn 0.2s ease; }
.cx-leaderboard-empty {
  padding: 20px;
  margin: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  body.portal-client .page {
    padding: 16px 14px 88px;
  }
  .cx-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .cx-hero .cx-toolbar {
    width: 100%;
  }
  .cx-hero .cx-btn {
    flex: 1;
    justify-content: center;
  }
  .cx-sticky-nav {
    top: 48px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .cx-sticky-nav a {
    flex-shrink: 0;
    font-size: 0.76rem;
    padding: 8px 12px;
  }
  .cx-sticky-nav a > span { display: none; }
  .cx-sticky-nav a i { font-size: 1.1rem; }
  .cx-bot-grid {
    grid-template-columns: 1fr;
  }
  .cx-bottom-nav { display: flex; }
  body.portal-client .topbar-user { display: none; }
  .cx-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .cx-search-wrap { max-width: none; }
}

/* Login page PRO */
body.portal-login {
  background: linear-gradient(160deg, #0f0f14 0%, #1a1a2e 50%, #0f0f14 100%);
}
body.portal-login .login-card {
  border-radius: 16px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}
body.portal-login .s-logo {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

/* Hide legacy back link when breadcrumbs present */
.cx-breadcrumb + .back,
.cx-breadcrumb ~ .back { display: none; }

.cx-breadcrumb + .back,
.cx-breadcrumb ~ .back { display: none; }
