/**
 * Hyperion Hub - UI/UX Premium Design System
 * Aesthetic Direction: High-Performance Pitch-Black / Developer Dark Mode
 * Theme Tokens:
 *   - Background: #080A0F (deep blueish canvas)
 *   - Cards / Panels: #10141D
 *   - Surface Secondary: #151B27
 *   - Borders: #252D3A (subtle) / #2E3848 (light hover)
 *   - Text: #F3F6FC (main) / #94A3B8 (muted) / #64748B (dim)
 *   - Accents: Electric Blue #3B82F6, Violet #8B5CF6
 *   - Feedback: Emerald #22C55E, Amber #F59E0B, Crimson #EF4444
 */

:root {
  /* Canvas & Surfaces */
  --bg-black: #05070B;
  --bg-canvas: #080A0F;
  --bg-sidebar: #0C1018;
  --bg-card: #10141D;
  --bg-card-hover: #151B27;
  --bg-surface: #151B27;
  --bg-input: #0B0F17;

  /* Borders */
  --border-subtle: #252D3A;
  --border-light: #2E3848;
  --border-focus: #3B82F6;

  /* Typography */
  --text-main: #F3F6FC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  /* Accent Colors */
  --primary: #3B82F6;
  --primary-hover: #2563EB;
  --primary-fg: #FFFFFF;
  --accent-blue: #3B82F6;
  --accent-purple: #8B5CF6;

  /* Status Colors */
  --success: #22C55E;
  --success-bg: rgba(34, 197, 94, 0.12);
  --success-border: rgba(34, 197, 94, 0.25);

  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.25);

  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.3);

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px -3px rgba(59, 130, 246, 0.25);

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
  background-color: var(--bg-canvas);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* Custom Minimalist Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-canvas);
}
::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

p {
  color: var(--text-muted);
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: #60A5FA;
}

code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.85em;
  color: #E2E8F0;
}

/* Focus Visibility */
:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  outline: none;
  white-space: nowrap;
  user-select: none;
  box-shadow: var(--shadow-sm);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  gap: 6px;
}
.btn-block {
  width: 100%;
}
.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.35);
}
.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-subtle);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  color: #FFFFFF;
}
.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
  border-color: var(--danger);
}
.btn-danger:hover {
  background: #DC2626;
  border-color: #DC2626;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.35);
}
.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger-border);
}
.btn-danger-outline:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: #F87171;
}
.btn-link {
  background: transparent;
  border: none;
  color: var(--accent-blue);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  box-shadow: none;
}
.btn-link:hover {
  color: #60A5FA;
  text-decoration: underline;
}
.btn-icon {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  box-shadow: none;
}
.btn-icon:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-subtle);
}

/* Form Controls */
.reseller-form, .reseller-actions {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}
.reseller-form label, .reseller-actions label { min-width: 0; font-size: .85rem; color: var(--text-muted); }
.reseller-form label { flex: 1 1 150px; }
.reseller-form .form-control, .reseller-actions .form-control { margin-top: 5px; }
.reseller-list { display: grid; gap: 16px; overflow-wrap: anywhere; }
.reseller-row + .reseller-row { padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.reseller-row p, #reseller-status { color: var(--text-muted); font-size: .85rem; margin: 5px 0 12px; }
.reseller-actions input { max-width: 140px; }
#view-resellers textarea { font-family: monospace; resize: vertical; }
@media (max-width: 600px) {
  .reseller-form label { flex-basis: 100%; }
  .reseller-actions label { flex-basis: 100%; }
}

.form-group {
  margin-bottom: 16px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 9px 13px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}
.form-control:hover:not(:focus) {
  border-color: var(--border-light);
}
.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.form-control::placeholder {
  color: var(--text-dim);
}
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
  cursor: pointer;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.85rem;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}
.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent-blue);
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.form-help {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 5px;
  line-height: 1.4;
}
.input-with-action {
  display: flex;
  gap: 8px;
}

/* AUTH SCREEN */
#auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-canvas);
  background-image: radial-gradient(circle at 50% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 65%);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 38px 32px;
  box-shadow: var(--shadow-xl);
  position: relative;
}
.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(139, 92, 246, 0.18));
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60A5FA;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: var(--shadow-glow);
}
.auth-brand h2 {
  font-size: 1.45rem;
  margin-bottom: 6px;
}
.auth-brand p {
  color: var(--text-muted);
  font-size: 0.84rem;
}
.auth-toggle {
  text-align: center;
  margin-top: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.auth-toggle span {
  margin-right: 6px;
}
.auth-security-notice {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.75rem;
  text-align: center;
}

/* APP LAYOUT */
#main-dashboard {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
aside.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  transition: width var(--transition-normal);
}

/* Collapsed Sidebar State (Desktop) */
aside.sidebar.collapsed {
  width: 72px;
}
aside.sidebar.collapsed .brand-text,
aside.sidebar.collapsed .sidebar-section-title,
aside.sidebar.collapsed .nav-item span,
aside.sidebar.collapsed .community-nav-link span,
aside.sidebar.collapsed .user-details,
aside.sidebar.collapsed .user-settings-icon {
  display: none !important;
}
aside.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding: 18px 0;
}
aside.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
}
aside.sidebar.collapsed .community-nav-link {
  justify-content: center;
  padding: 8px 0;
}
aside.sidebar.collapsed .user-pill {
  justify-content: center;
  padding: 8px 0;
}

.sidebar-brand {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar-logo {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(139, 92, 246, 0.16));
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60A5FA;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}
.brand-badge {
  font-size: 0.7rem;
  color: var(--success);
  font-weight: 500;
  white-space: nowrap;
}

.sidebar-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
}
.nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}
.nav-item.active {
  color: #FFFFFF;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  font-weight: 600;
}
.nav-item.active svg {
  color: var(--accent-blue);
}

.sidebar-community-section {
  padding: 14px 12px;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}
.sidebar-section-title {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 8px;
  padding-left: 6px;
  white-space: nowrap;
}
.community-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.community-nav-link:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-subtle);
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  position: relative;
}
.user-pill:hover {
  background: rgba(255, 255, 255, 0.05);
}
.user-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(139, 92, 246, 0.25));
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid var(--border-light);
}
.online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--success);
  border: 2px solid var(--bg-sidebar);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
}
.user-details {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.user-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.user-settings-icon {
  color: var(--text-dim);
  transition: color var(--transition-fast);
}
.user-pill:hover .user-settings-icon {
  color: var(--text-main);
}

/* MAIN CONTENT */
main.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-canvas);
}

/* TOP NAVIGATION */
.top-nav {
  height: 60px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-sidebar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
  gap: 16px;
}
.top-nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.app-switcher-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-switcher-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}
.app-dropdown {
  min-width: 220px;
  font-weight: 600;
  padding: 6px 12px;
  height: 36px;
  background-color: var(--bg-input);
}
.top-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Seller Key Secret Badge */
.seller-key-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 5px 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}
.seller-key-badge:hover {
  border-color: var(--border-light);
}
.seller-key-badge code {
  color: var(--text-main);
  background: transparent;
  padding: 0;
  border: none;
  font-size: 0.82rem;
}

.header-social-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.header-social-btn {
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  padding: 6px;
}
.header-social-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
}

/* CONTENT CONTAINER */
.content-container {
  padding: 28px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}
.view-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}
.view-panel.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* SECTION HEADERS */
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}
.section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.section-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* APP BANNER (DASHBOARD) */
.app-banner {
  background: var(--bg-card);
  background-image: radial-gradient(ellipse at top right, rgba(59, 130, 246, 0.07), transparent 60%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-md);
}
.app-banner-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.app-banner-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-banner-title-row h1 {
  font-size: 1.45rem;
}
.app-banner-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.app-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Secret Visibility Pill */
.secret-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* KPI CARDS */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.kpi-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kpi-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60A5FA;
}
.kpi-icon.success {
  color: var(--success);
  background: var(--success-bg);
}
.kpi-icon.warning {
  color: var(--warning);
  background: var(--warning-bg);
}
.kpi-icon.purple {
  color: #C084FC;
  background: rgba(139, 92, 246, 0.12);
}
.kpi-value {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.kpi-footer {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* INVENTORY DISTRIBUTION CARD */
.distribution-card {
  padding: 20px 24px;
  margin-bottom: 24px;
}
.distribution-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.distribution-bar-wrapper {
  width: 100%;
  height: 12px;
  background: #0B0F17;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}
.distribution-bar {
  display: flex;
  height: 100%;
  width: 100%;
}
.dist-segment {
  height: 100%;
  transition: width 0.4s ease;
}
.dist-active { background: #22C55E; }
.dist-unused { background: #F59E0B; }
.dist-expired { background: #64748B; }
.dist-banned { background: #EF4444; }

.distribution-legend {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.dist-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
}
.dist-legend-item strong {
  color: var(--text-main);
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  display: inline-block;
}
.legend-dot.active { background: #22C55E; }
.legend-dot.unused { background: #F59E0B; }
.legend-dot.expired { background: #64748B; }
.legend-dot.banned { background: #EF4444; }

/* CODE SNIPPET CARD */
.snippet-card {
  margin-bottom: 24px;
}
.snippet-header {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.snippet-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.snippet-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
}
.code-tabs {
  display: flex;
  gap: 4px;
  background: #0B0F17;
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
.code-tab {
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.code-tab.active {
  color: #FFFFFF;
  background: var(--bg-card-hover);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.code-tab:hover:not(.active) {
  color: var(--text-main);
}
.snippet-body {
  padding: 18px 22px;
  background: #07090E;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  overflow-x: auto;
}
.code-block {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.6;
  color: #E2E8F0;
  background: transparent;
  padding: 0;
  border: none;
  border-radius: 0;
  display: block;
}

/* PANEL CARDS & TABLES */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}
.panel-card-body {
  padding: 22px;
}
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84rem;
}
.data-table th {
  padding: 12px 18px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 18px;
  color: #CBD5E1;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background var(--transition-fast);
}
.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 52px 24px !important;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.empty-state-inner {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.empty-state-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  margin-bottom: 4px;
}

/* FILTERS & BULK BAR */
.filter-card {
  padding: 16px 20px;
  margin-bottom: 20px;
}
.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.filter-group-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  flex-wrap: wrap;
}
.search-input-wrapper {
  position: relative;
  max-width: 320px;
  width: 100%;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}
.search-input {
  padding-left: 36px;
}
.filter-select {
  max-width: 180px;
}
.bulk-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.selection-bar {
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: fadeIn 0.2s ease;
}
.selection-bar-actions {
  display: flex;
  gap: 8px;
}

/* STATUS CHIPS */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.status-chip.active {
  background: var(--success-bg);
  color: #34D399;
  border: 1px solid var(--success-border);
}
.status-chip.unused {
  background: var(--warning-bg);
  color: #FBBF24;
  border: 1px solid var(--warning-border);
}
.status-chip.expired {
  background: rgba(148, 163, 184, 0.12);
  color: #94A3B8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.status-chip.banned {
  background: var(--danger-bg);
  color: #F87171;
  border: 1px solid var(--danger-border);
}

/* LOG EVENT BADGES */
.event-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.event-login-success { background: var(--success-bg); color: #34D399; border: 1px solid var(--success-border); }
.event-login-failed { background: var(--warning-bg); color: #FBBF24; border: 1px solid var(--warning-border); }
.event-hwid-mismatch { background: var(--danger-bg); color: #F87171; border: 1px solid var(--danger-border); }
.event-hwid-reset { background: rgba(168, 85, 247, 0.12); color: #C084FC; border: 1px solid rgba(168, 85, 247, 0.25); }
.event-keys-gen { background: rgba(59, 130, 246, 0.12); color: #60A5FA; border: 1px solid rgba(59, 130, 246, 0.25); }
.event-bulk-delete { background: rgba(249, 115, 22, 0.12); color: #FB923C; border: 1px solid rgba(249, 115, 22, 0.25); }
.event-system { background: rgba(148, 163, 184, 0.12); color: #CBD5E1; border: 1px solid rgba(148, 163, 184, 0.25); }

/* MODALS */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 11, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active {
  display: flex;
}
.modal-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: modalEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
}
.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}
.modal-close-btn:hover {
  color: #FFFFFF;
}
.modal-body {
  padding: 24px;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(255, 255, 255, 0.015);
}

/* CONFIRM MODAL */
.modal-confirm-card {
  max-width: 440px;
}

/* PROFILE MODAL */
.modal-profile-card {
  max-width: 760px;
}
.profile-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  min-height: 400px;
}
.profile-nav {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: transparent;
  border: none;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
}
.profile-nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}
.profile-nav-item.active {
  color: #FFFFFF;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  font-weight: 600;
}
.profile-nav-item.danger {
  color: #F87171;
  margin-top: auto;
}
.profile-nav-item.danger:hover {
  background: var(--danger-bg);
}
.profile-content {
  padding: 24px;
  overflow-y: auto;
}
.ptab-pane {
  display: none;
}
.ptab-pane.active {
  display: block;
  animation: fadeIn 0.2s ease;
}
.profile-user-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.profile-avatar-big {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(139, 92, 246, 0.25));
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  font-weight: 700;
  border: 2px solid var(--border-light);
}
.plan-card-box {
  background: #0B0F17;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
}
.plan-card-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.plan-features-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: #CBD5E1;
}
.session-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: #0B0F17;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
.danger-box {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

/* TOAST NOTIFICATIONS */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 420px;
  animation: toastSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-left-width: 4px;
}
@keyframes toastSlide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast-success { border-left-color: var(--success); }
.toast-danger { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-primary { border-left-color: var(--primary); }

/* SOCIAL & COMMUNITY INTEGRATIONS */
.auth-social-bar {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}
.auth-social-link {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}
.auth-social-link:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-light);
  color: #FFFFFF;
}

/* MOBILE DRAWER & RESPONSIVENESS */
.mobile-menu-toggle {
  display: none;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 4, 10, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 110;
}

@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  body.sidebar-mobile-open {
    overflow: hidden;
  }
  .mobile-menu-toggle {
    display: inline-flex;
  }
  aside.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(272px, 84vw);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.24s ease;
    z-index: 120;
    background: #100e17;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.85);
    overflow-y: auto;
  }
  aside.sidebar.open {
    transform: translateX(0);
    visibility: visible;
  }
  .sidebar-backdrop.active {
    display: block;
  }
  .top-nav {
    padding: 0 16px;
    height: 56px;
  }
  .content-container {
    padding: 16px;
  }
  .app-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .app-banner-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .app-banner-actions .btn {
    flex: 1;
    min-width: 120px;
  }
  .seller-key-badge .seller-label {
    display: none;
  }
  .profile-layout {
    grid-template-columns: 1fr;
  }
  .profile-nav {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 8px;
  }
  .profile-nav-item {
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .top-nav-right .btn-sm span {
    display: none;
  }
  .top-nav-right .btn-sm {
    padding: 6px 9px;
  }
  .auth-social-bar {
    flex-direction: column;
  }
  .app-switcher-label {
    display: none;
  }
  .modal-card {
    width: 96vw;
    margin: 8px;
    max-height: 88vh;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-group-left {
    flex-direction: column;
    align-items: stretch;
  }
  .search-input-wrapper {
    max-width: 100%;
  }
  .filter-select {
    max-width: 100%;
  }
  .bulk-actions-group {
    width: 100%;
  }
  .bulk-actions-group .btn {
    flex: 1;
    min-width: 120px;
  }
  .selection-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .selection-bar-actions {
    width: 100%;
  }
  .selection-bar-actions .btn {
    flex: 1;
  }
}

/* NO APP SELECTED STATE */
.no-app-selected-card {
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed var(--border-subtle);
  background: radial-gradient(circle at top center, rgba(59, 130, 246, 0.05) 0%, rgba(16, 20, 29, 0.8) 75%);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}
.no-app-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 580px;
  margin: 0 auto;
}
.no-app-icon-badge {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  margin-bottom: 20px;
}
.no-app-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 10px 0;
  letter-spacing: -0.02em;
}
.no-app-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 24px 0;
}
.no-app-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.quick-apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  width: 100%;
}
.quick-app-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}
.quick-app-card:hover {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.08);
  transform: translateY(-2px);
}
.quick-app-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: #fff;
}
.quick-app-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* =============================================================
   OAuth Social Login & 2FA Components
   ============================================================= */

.auth-oauth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0 14px 0;
  color: var(--text-dim);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.auth-oauth-divider::before,
.auth-oauth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}
.auth-oauth-divider span {
  padding: 0 10px;
}

.auth-oauth-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.btn-oauth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
}
.btn-oauth:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-1px);
}
.btn-oauth.btn-google:hover {
  border-color: rgba(66, 133, 244, 0.5);
}
.btn-oauth.btn-discord:hover {
  border-color: rgba(88, 101, 242, 0.5);
}

/* 2FA Setup & Security Card Styles */
.two-factor-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 20px;
}
.two-factor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.two-factor-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.social-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.social-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  gap: 12px;
}
.social-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.social-item-meta {
  display: flex;
  flex-direction: column;
}
.social-item-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: #fff;
}
.social-item-status {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.backup-codes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #080A0F;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 16px 0;
}
.backup-code-item {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: #60A5FA;
  text-align: center;
  padding: 6px;
  background: #10141D;
  border-radius: 4px;
  letter-spacing: 1px;
}

.totp-qr-display {
  background: #fff;
  padding: 12px;
  border-radius: var(--radius-md);
  display: inline-block;
  margin: 14px auto;
  text-align: center;
}

/* -------------------------------------------------------------
   SUBSCRIPTION PLANS & PRICING STYLES
   ------------------------------------------------------------- */
.badge-plan-pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: inline-flex;
  align-items: center;
}
.badge-plan-free {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.2);
}
.badge-plan-plus {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.4);
}

.pricing-header {
  text-align: center;
  max-width: 680px;
  margin: 10px auto 32px auto;
}
.pricing-headline {
  font-size: 2.1rem;
  font-weight: 800;
  color: #f3f6fc;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.pricing-subtext {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* Usage banner */
.pricing-usage-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 960px;
  margin: 0 auto 32px auto;
}
.pricing-usage-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.usage-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.usage-plan-badge {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f3f6fc;
}
.pricing-usage-divider {
  width: 1px;
  height: 44px;
  background: var(--border-subtle);
}
.usage-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.usage-progress-bar {
  width: 100%;
  height: 8px;
  background: #080A0F;
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.usage-progress-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* Billing switcher */
.billing-switcher-container {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}
.billing-switcher {
  display: inline-flex;
  background: var(--bg-card);
  padding: 4px;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
}
.billing-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.billing-toggle-btn.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.save-pill {
  font-size: 0.7rem;
  background: rgba(34, 197, 94, 0.18);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.35);
  padding: 2px 7px;
  border-radius: 9999px;
  font-weight: 700;
}
.billing-toggle-btn.active .save-pill {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Pricing cards grid */
.pricing-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
}
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.25s ease;
}
.pricing-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}
.pricing-card.featured {
  background: linear-gradient(180deg, #101524 0%, #0d121c 100%);
  border: 2px solid var(--accent-primary);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.12);
}
.pricing-badge-popular {
  position: absolute;
  top: -12px;
  right: 28px;
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 12px;
  border-radius: 9999px;
}
.plan-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.plan-tag.tag-plus {
  color: #60a5fa;
}
.plan-name {
  font-size: 1.55rem;
  font-weight: 700;
  color: #f3f6fc;
  margin-bottom: 6px;
}
.plan-summary {
  font-size: 0.86rem;
  color: var(--text-dim);
  min-height: 42px;
  line-height: 1.45;
  margin-bottom: 20px;
}
.plan-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}
.plan-price .currency {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f3f6fc;
}
.plan-price .amount {
  font-size: 2.8rem;
  font-weight: 800;
  color: #f3f6fc;
  letter-spacing: -0.03em;
  line-height: 1;
}
.plan-price .currency-code {
  font-size: 0.9rem;
  font-weight: 700;
  color: #60a5fa;
  margin-left: 2px;
}
.plan-price .period {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-left: 4px;
}
.plan-price-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
}
.plan-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 22px 0;
}
.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.86rem;
  color: #d1d5db;
  line-height: 1.4;
}
.plan-features li svg {
  flex-shrink: 0;
  color: #22c55e;
  margin-top: 2px;
}
.plan-features li.feature-highlight {
  color: #fff;
}
.plan-features li.feature-highlight svg {
  color: #60a5fa;
}
.plan-features li.feature-disabled {
  color: #64748b;
}
.plan-features li.feature-disabled svg {
  color: #475569;
}
.pricing-card-footer {
  margin-top: auto;
}

/* Upgrade modal styles */
.upgrade-summary-card {
  background: #080A0F;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}
.upgrade-account-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #080A0F;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

/* Superadmin change plan modal radio cards */
.plan-select-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 8px;
}
.plan-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.plan-radio-card:hover {
  border-color: var(--border-light);
}
.plan-radio-card input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--accent-primary);
}
.plan-radio-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.plan-radio-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: #f3f6fc;
}
.plan-radio-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.35;
}

@media (max-width: 860px) {
  .pricing-usage-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .pricing-usage-divider {
    width: 100%;
    height: 1px;
  }
  .pricing-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* Keep account actions and SDK samples usable on narrow screens. */
#view-docs pre.code-block { overflow-x: auto; max-width: 100%; padding-bottom: 10px; }
:focus-visible { outline: 2px solid #60a5fa; outline-offset: 3px; }
@media (max-width: 1180px) {
  .top-nav { height: auto; min-height: 60px; flex-wrap: wrap; padding: 10px 16px; }
  .top-nav-right { flex-wrap: wrap; min-width: 0; }
}
@media (max-width: 640px) {
  .top-nav-left, .top-nav-right { width: 100%; }
  .app-switcher-wrapper { flex: 1; min-width: 0; }
  .app-dropdown { min-width: 0; width: 100%; }
  .app-switcher-label, .sidebar-collapse-toggle { display: none; }
  .seller-key-badge { max-width: 190px; }
}

.reseller-login-link { margin-top: 12px; }

.license-mask-editor { min-width: 0; flex: 1 0 100%; }
.license-mask-editor label { display: block; }
.license-mask-editor [data-custom] { margin-top: 10px; }
.license-mask-editor [data-help], .license-mask-editor [data-preview] span { color: var(--text-muted); font-size: .82rem; }
.license-mask-editor [data-error] { color: #fca5a5; font-size: .82rem; }
.license-mask-editor [data-preview]:not([hidden]) { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 4px 10px; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.license-mask-editor [data-preview] span { grid-column: 1 / -1; }
.license-mask-editor code { overflow-wrap: anywhere; font-family: var(--font-mono, monospace); }
