/* ==========================================================================
   VEXIA DESIGN SYSTEM — Minimalist Violet/Purple (Auto + Manual Dark/Light)
   Domain: vexia.alfastage.com.br | Port: 8787
   ========================================================================== */

:root,
[data-theme="dark"] {
  --vx-purple-600: #7C3AED;
  --vx-purple-500: #8B5CF6;
  --vx-purple-400: #A855F7;
  --vx-purple-300: #C084FC;
  --vx-purple-glow: rgba(124, 58, 237, 0.28);
  --vx-purple-subtle: rgba(139, 92, 246, 0.12);
  --vx-purple-border: rgba(139, 92, 246, 0.22);

  --bg-base: #09090B;
  --bg-surface: #121217;
  --bg-elevated: #181820;
  --bg-glass: rgba(18, 18, 23, 0.82);
  --bg-input: #0E0E13;
  --bg-hover: rgba(139, 92, 246, 0.08);
  --bg-code: #0B0B0F;

  --text-primary: #F8FAFC;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
  --text-on-accent: #FFFFFF;

  --border-subtle: rgba(139, 92, 246, 0.18);
  --border-neutral: rgba(255, 255, 255, 0.08);
  --border-focus: #8B5CF6;

  --status-success: #10B981;
  --status-success-bg: rgba(16, 185, 129, 0.14);
  --status-warning: #F59E0B;
  --status-warning-bg: rgba(245, 158, 11, 0.14);
  --status-danger: #EF4444;
  --status-danger-bg: rgba(239, 68, 68, 0.14);
  --status-info: #38BDF8;
  --status-info-bg: rgba(56, 189, 248, 0.14);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(139, 92, 246, 0.12);
  --shadow-lg: 0 18px 42px rgba(0, 0, 0, 0.65), 0 0 24px rgba(124, 58, 237, 0.18);

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --sidebar-width: 268px;
  --topbar-height: 66px;
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

/* Automatic system light mode when data-theme is "system" (or not forced dark) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --vx-purple-600: #7C3AED;
    --vx-purple-500: #8B5CF6;
    --vx-purple-400: #A855F7;
    --vx-purple-300: #6D28D9;
    --vx-purple-glow: rgba(124, 58, 237, 0.16);
    --vx-purple-subtle: #F5F3FF;
    --vx-purple-border: rgba(124, 58, 237, 0.24);

    --bg-base: #FAFAFC;
    --bg-surface: #FFFFFF;
    --bg-elevated: #F4F3F8;
    --bg-glass: rgba(255, 255, 255, 0.88);
    --bg-input: #FFFFFF;
    --bg-hover: #F5F3FF;
    --bg-code: #F8F7FC;

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --text-on-accent: #FFFFFF;

    --border-subtle: rgba(139, 92, 246, 0.18);
    --border-neutral: rgba(15, 23, 42, 0.09);
    --border-focus: #7C3AED;

    --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 6px 20px rgba(124, 58, 237, 0.08), 0 0 0 1px rgba(139, 92, 246, 0.14);
    --shadow-lg: 0 16px 36px rgba(124, 58, 237, 0.14), 0 0 0 1px rgba(139, 92, 246, 0.2);
  }
}

/* Explicit Manual Light Theme */
[data-theme="light"] {
  --vx-purple-600: #7C3AED;
  --vx-purple-500: #8B5CF6;
  --vx-purple-400: #A855F7;
  --vx-purple-300: #6D28D9;
  --vx-purple-glow: rgba(124, 58, 237, 0.16);
  --vx-purple-subtle: #F5F3FF;
  --vx-purple-border: rgba(124, 58, 237, 0.24);

  --bg-base: #FAFAFC;
  --bg-surface: #FFFFFF;
  --bg-elevated: #F4F3F8;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --bg-input: #FFFFFF;
  --bg-hover: #F5F3FF;
  --bg-code: #F8F7FC;

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-on-accent: #FFFFFF;

  --border-subtle: rgba(139, 92, 246, 0.18);
  --border-neutral: rgba(15, 23, 42, 0.09);
  --border-focus: #7C3AED;

  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 20px rgba(124, 58, 237, 0.08), 0 0 0 1px rgba(139, 92, 246, 0.14);
  --shadow-lg: 0 16px 36px rgba(124, 58, 237, 0.14), 0 0 0 1px rgba(139, 92, 246, 0.2);
}

/* ==========================================================================
   BASE RESET & TYPOGRAPHY
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

a {
  color: var(--vx-purple-400);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code, pre, .mono {
  font-family: var(--font-mono);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--vx-purple-500);
}

/* ==========================================================================
   APP SHELL LAYOUT (Sidebar + Main Area)
   ========================================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.sidebar-brand {
  height: var(--topbar-height);
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-neutral);
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--vx-purple-600), var(--vx-purple-400));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 4px 14px var(--vx-purple-glow);
  letter-spacing: -0.5px;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  background: linear-gradient(90deg, var(--text-primary), var(--vx-purple-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  display: block;
  font-weight: 500;
  margin-top: -2px;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 10px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13.2px;
  text-align: left;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.85;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--vx-purple-subtle);
  color: var(--vx-purple-400);
  border-color: var(--border-subtle);
  font-weight: 600;
}

[data-theme="light"] .nav-item.active {
  color: var(--vx-purple-600);
}

.nav-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--vx-purple-subtle);
  color: var(--vx-purple-400);
  border: 1px solid var(--border-subtle);
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border-neutral);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-mini-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--vx-purple-600), var(--vx-purple-400));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-meta {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   MAIN CONTENT & TOPBAR
   ========================================================================== */
.main-area {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mobile-menu-btn {
  display: none;
  padding: 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-neutral);
  color: var(--text-primary);
}

.view-header-title {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.view-header-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: none;
}

@media (min-width: 1100px) {
  .view-header-sub {
    display: inline-block;
    padding-left: 10px;
    border-left: 1px solid var(--border-neutral);
  }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-success);
  box-shadow: 0 0 8px var(--status-success);
}

.status-dot.warm {
  background: var(--status-warning);
  box-shadow: 0 0 8px var(--status-warning);
}

.status-dot.cold {
  background: var(--status-info);
  box-shadow: 0 0 8px var(--status-info);
}

.wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--vx-purple-subtle);
  border: 1px solid var(--vx-purple-border);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  transition: transform var(--transition-fast);
}

.wallet-pill:hover {
  transform: translateY(-1px);
}

.wallet-amount {
  color: var(--vx-purple-400);
  font-family: var(--font-mono);
  font-weight: 700;
}

[data-theme="light"] .wallet-amount {
  color: var(--vx-purple-600);
}

.theme-segmented {
  display: inline-flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border-neutral);
  border-radius: var(--radius-full);
  padding: 2px;
}

.theme-btn {
  padding: 4px 9px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.theme-btn.active {
  background: var(--vx-purple-600);
  color: #fff;
  box-shadow: 0 2px 6px var(--vx-purple-glow);
}

/* ==========================================================================
   VIEW CONTAINER & CARDS
   ========================================================================== */
.content-wrap {
  padding: 24px;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.view-section {
  display: none;
  flex-direction: column;
  gap: 22px;
  animation: fadeIn 180ms ease-out;
}

.view-section.active {
  display: flex;
}

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

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
  border-color: var(--vx-purple-border);
}

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

.card-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ==========================================================================
   GRID SYSTEMS & KPI CARDS
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--vx-purple-600), var(--vx-purple-400));
  opacity: 0.85;
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  letter-spacing: -0.6px;
}

.kpi-foot {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

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

/* ==========================================================================
   BUTTONS, BADGES & PILLS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--vx-purple-600), var(--vx-purple-500));
  color: #FFFFFF;
  box-shadow: 0 3px 12px var(--vx-purple-glow);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--vx-purple-subtle);
  color: var(--vx-purple-400);
  border-color: var(--vx-purple-border);
}

[data-theme="light"] .btn-secondary {
  color: var(--vx-purple-600);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.2);
}

.btn-ghost {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border-neutral);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-subtle);
  background: var(--bg-hover);
}

.btn-success {
  background: var(--status-success);
  color: #fff;
}

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

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-xs);
}

.btn-lg {
  padding: 11px 20px;
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge-purple {
  background: var(--vx-purple-subtle);
  color: var(--vx-purple-400);
  border-color: var(--vx-purple-border);
}

[data-theme="light"] .badge-purple {
  color: var(--vx-purple-600);
}

.badge-success {
  background: var(--status-success-bg);
  color: var(--status-success);
  border-color: rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: var(--status-warning-bg);
  color: var(--status-warning);
  border-color: rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.badge-info {
  background: var(--status-info-bg);
  color: var(--status-info);
  border-color: rgba(56, 189, 248, 0.3);
}

/* ==========================================================================
   FORMS, INPUTS & TABS
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.input, .select, .textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-neutral);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 13.5px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.textarea {
  min-height: 90px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-neutral);
  padding-bottom: 10px;
  flex-wrap: wrap;
}

.tab-pill {
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 12.8px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-neutral);
  transition: all var(--transition-fast);
}

.tab-pill:hover {
  color: var(--text-primary);
}

.tab-pill.active {
  background: var(--vx-purple-600);
  color: #fff;
  border-color: var(--vx-purple-500);
  box-shadow: 0 2px 10px var(--vx-purple-glow);
}

/* ==========================================================================
   MARKETPLACE & MODEL CARDS (GitHub Style)
   ========================================================================== */
.model-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.model-card:hover {
  transform: translateY(-2px);
  border-color: var(--vx-purple-500);
  box-shadow: var(--shadow-md);
}

.model-repo-path {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--vx-purple-400);
  display: flex;
  align-items: center;
  gap: 6px;
  word-break: break-all;
}

[data-theme="light"] .model-repo-path {
  color: var(--vx-purple-600);
}

.model-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
}

.model-desc {
  font-size: 12.8px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: var(--bg-elevated);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-neutral);
}

.metric-mini {
  display: flex;
  flex-direction: column;
}

.metric-mini-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.metric-mini-val {
  font-size: 12.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.model-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-neutral);
  flex-wrap: wrap;
}

.git-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ==========================================================================
   TABLES, CODE BLOCKS & PROBABILITY BARS
   ========================================================================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-neutral);
  border-radius: var(--radius-sm);
}

table.vx-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12.8px;
}

table.vx-table th {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-neutral);
  white-space: nowrap;
}

table.vx-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-neutral);
  color: var(--text-primary);
  vertical-align: middle;
}

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

table.vx-table tr:hover td {
  background: var(--bg-hover);
}

.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  overflow-x: auto;
  position: relative;
  line-height: 1.55;
  white-space: pre;
}

.prob-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.prob-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
}

.prob-track {
  height: 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-neutral);
}

.prob-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--vx-purple-600), var(--vx-purple-400));
  border-radius: var(--radius-full);
  transition: width 260ms ease-out;
}

/* ==========================================================================
   WIZARD STEPS (STUDIO KAGGLE)
   ========================================================================== */
.wizard-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.wizard-step {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-neutral);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.wizard-step.active {
  border-color: var(--vx-purple-500);
  background: var(--vx-purple-subtle);
}

.wizard-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.wizard-step.active .wizard-step-num {
  background: var(--vx-purple-600);
  color: #fff;
}

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

/* ==========================================================================
   AUTH SCREEN & MODAL OVERLAYS
   ========================================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 15%, rgba(124, 58, 237, 0.22), var(--bg-base) 70%);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-overlay.hidden {
  display: none;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--vx-purple-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.72);
  backdrop-filter: blur(6px);
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--vx-purple-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--vx-purple-500);
  border-left: 4px solid var(--vx-purple-500);
  color: var(--text-primary);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 500;
  animation: fadeIn 150ms ease-out;
}

/* Responsive Sidebar Drawer */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-area {
    margin-left: 0;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
}
