/* ── Design tokens ───────────────────────────────────────────────── */
:root {
  --bg:            #090910;
  --surface:       #111119;
  --surface2:      #181824;
  --surface3:      #1f1f2d;
  --border:        rgba(255,255,255,0.065);
  --border2:       rgba(255,255,255,0.11);
  --text:          #e6e6f0;
  --text2:         #7878a0;
  --text3:         #48486a;
  --accent:        #7c3aed;
  --accent-glow:   rgba(124,58,237,0.22);
  --blue:          #3b82f6;
  --green:         #10b981;
  --red:           #ef4444;
  --amber:         #f59e0b;
  --indigo:        #818cf8;
  --sidebar-w:     248px;
  --r:             14px;
  --rs:            10px;
  --rx:            6px;
  --sans:          'Plus Jakarta Sans', system-ui, sans-serif;
  --mono:          'JetBrains Mono', monospace;
  --t:             160ms ease;

  /* Legacy aliases kept for app.js compatibility */
  --bg-primary:        #090910;
  --bg-secondary:      #111119;
  --glass-bg:          rgba(255,255,255,0.03);
  --glass-border:      rgba(255,255,255,0.065);
  --glass-hover:       rgba(255,255,255,0.05);
  --text-primary:      #e6e6f0;
  --text-secondary:    #7878a0;
  --text-tertiary:     #48486a;
  --accent-blue:       #3b82f6;
  --accent-purple:     #7c3aed;
  --accent-pink:       #ec4899;
  --accent-green:      #10b981;
  --accent-orange:     #f59e0b;
  --gradient-1:        linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
  --gradient-2:        linear-gradient(135deg, #db2777 0%, #9333ea 100%);
  --gradient-3:        linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
}

*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html { height:100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  font-size: 14px;
}

/* ── Background ──────────────────────────────────────────────────── */
.bg-gradient {
  position: fixed; top:0; left:0; width:100%; height:100%;
  z-index: 0; overflow: hidden; pointer-events: none;
}
.gradient-orb {
  position: absolute; border-radius: 50%;
  filter: blur(140px); opacity: 0.14;
  animation: float 32s ease-in-out infinite;
}
.orb-1 { width:800px; height:800px; background:linear-gradient(135deg,#7c3aed,#4f46e5); top:-380px; left:-180px; }
.orb-2 { width:580px; height:580px; background:linear-gradient(135deg,#db2777,#9333ea); bottom:-220px; right:-120px; animation-delay:-13s; }
.orb-3 { width:420px; height:420px; background:linear-gradient(135deg,#0ea5e9,#6366f1); top:42%; left:46%; animation-delay:-22s; }
@keyframes float {
  0%,100% { transform:translate(0,0) scale(1); }
  33%  { transform:translate(30px,-22px) scale(1.07); }
  66%  { transform:translate(-22px,30px) scale(0.93); }
}
.grid-pattern {
  position: fixed; top:0; left:0; width:100%; height:100%;
  z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 56px 56px;
}

/* ── Layout ──────────────────────────────────────────────────────── */
#root { position:relative; z-index:1; display:flex; min-height:100vh; }

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: rgba(9,9,16,0.92);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  position: fixed;
  top:0; left:0; bottom:0;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-logo {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
}
.sidebar-logo .logo-mark {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #fff;
  flex-shrink: 0;
}
.sidebar-logo .logo-text {
  font-size: 15px; font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-logo .logo-tagline {
  font-size: 10px; color: var(--text3); letter-spacing: 0.03em; margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--text2);
  text-decoration: none;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all var(--t);
  margin-bottom: 1px;
  border: 1px solid transparent;
  position: relative;
  white-space: nowrap;
  user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,0.035); color: var(--text); }
.nav-item.active {
  background: rgba(124,58,237,0.11);
  color: var(--text);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 22%; bottom: 22%;
  width: 2.5px; background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; opacity: 0.7; }
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.user-info {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px;
  border-radius: 9px;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
}
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-details { flex: 1; min-width: 0; }
.user-email { font-size: 11px; color: var(--text2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.plan-badge {
  display: inline-block;
  padding: 1px 6px; border-radius: 5px;
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  background: rgba(124,58,237,0.2); color: #a78bfa;
}
.plan-badge.pro   { background: rgba(59,130,246,0.2);  color: var(--blue); }
.plan-badge.team  { background: rgba(16,185,129,0.2);  color: var(--green); }

.btn-logout {
  width: 100%; padding: 8px 12px; border-radius: 8px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text2); font-size: 12px; font-weight: 500;
  cursor: pointer; font-family: var(--sans);
  transition: all var(--t);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-logout:hover { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.3); color: var(--red); }

/* ── Main Content ────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  padding: 28px 32px;
  overflow-y: auto;
}

.page { display: none; }
.page.active { display: block; }

/* ── Auth Layout ─────────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}
.auth-brand {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 60px;
  background: rgba(124,58,237,0.03);
  border-right: 1px solid var(--border);
}
.auth-brand-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 48px; }
.auth-brand-logo .lm {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; color: #fff;
}
.auth-brand-logo .lt {
  font-size: 22px; font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-brand h1 { font-size: 40px; font-weight: 800; line-height: 1.2; margin-bottom: 20px; }
.auth-brand h1 span {
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-brand p { font-size: 16px; color: var(--text2); max-width: 460px; line-height: 1.7; }
.auth-features { margin-top: 48px; display: flex; flex-direction: column; gap: 16px; }
.auth-feature { display: flex; align-items: center; gap: 14px; }
.auth-feature-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0;
}
.auth-feature p { font-size: 14px; color: var(--text2); }
.auth-feature strong { color: var(--text); }

.auth-form-side {
  width: 480px; flex-shrink: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 60px 48px;
}
.auth-form-side h2 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.auth-form-side .subtitle { font-size: 13px; color: var(--text2); margin-bottom: 28px; }

/* ── Forms ───────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 13px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--rs); color: var(--text); font-size: 13px; font-family: var(--sans);
  outline: none; transition: border-color var(--t), background var(--t);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  background: rgba(124,58,237,0.05);
}
.form-input::placeholder { color: var(--text3); }
select.form-input, select.form-select { appearance: none; cursor: pointer; }
select.form-input option, select.form-select option, select option { background: var(--surface2); color: var(--text); }
textarea.form-input, .form-textarea { resize: vertical; min-height: 90px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--rs); font-size: 13px; font-weight: 700;
  cursor: pointer; border: none; transition: all var(--t);
  text-decoration: none; font-family: var(--sans); letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 16px rgba(124,58,237,0.3);
}
.btn-primary:hover { background: #6d28d9; transform: translateY(-1px); box-shadow: 0 6px 22px rgba(124,58,237,0.4); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-secondary { background: var(--surface2); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--surface3); border-color: var(--border2); }
.btn-danger { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: var(--red); }
.btn-danger:hover { background: rgba(239,68,68,0.18); }
.btn-sm  { padding: 5px 13px; font-size: 12px; }
.btn-xs  { padding: 3px 9px;  font-size: 11px; border-radius: var(--rx); }
.btn-full { width: 100%; }

.form-link { color: #a78bfa; cursor: pointer; text-decoration: none; }
.form-link:hover { text-decoration: underline; }
.form-footer { margin-top: 20px; text-align: center; font-size: 13px; color: var(--text2); }

.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text3); font-size: 12px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  transition: all var(--t);
  position: relative;
  overflow: hidden;
}
.card:hover { background: var(--surface2); border-color: var(--border2); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
.card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  opacity: 0; transition: opacity var(--t);
}
.card:hover::after { opacity: 1; }

.card-title { font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.card-value { font-size: 28px; font-weight: 800; color: var(--text); font-family: var(--mono); }
.card-sub   { font-size: 12px; color: var(--text3); margin-top: 4px; }

/* ── Page Header ─────────────────────────────────────────────────── */
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.page-header p { font-size: 13px; color: var(--text2); }
.page-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.page-header-row h1 { font-size: 24px; font-weight: 800; }

/* ── Stats Row ───────────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 24px; }

/* ── Job table ───────────────────────────────────────────────────── */
.job-table { width: 100%; border-collapse: collapse; }
.job-table th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; font-weight: 700;
  color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
.job-table td { padding: 11px 14px; border-bottom: 1px solid rgba(255,255,255,0.035); font-size: 13px; vertical-align: middle; }
.job-table tr:hover td { background: rgba(255,255,255,0.02); }
.job-table tr:last-child td { border-bottom: none; }

/* ── Status Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.03em;
}
.badge-queued    { background: rgba(245,158,11,0.12);  color: var(--amber); }
.badge-running   { background: rgba(129,140,248,0.12); color: var(--indigo); }
.badge-completed { background: rgba(16,185,129,0.12);  color: var(--green); }
.badge-failed    { background: rgba(239,68,68,0.12);   color: var(--red); }
.badge-cancelled { background: rgba(120,120,160,0.08); color: var(--text3); }
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-running .badge-dot { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ── Drawer ──────────────────────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity var(--t);
  backdrop-filter: blur(4px);
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 480px;
  background: rgba(11,11,18,0.98); backdrop-filter: blur(24px);
  border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform 0.28s ease;
  z-index: 201; display: flex; flex-direction: column;
  overflow-y: auto; padding: 26px;
}
.drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.drawer-header h3 { font-size: 17px; font-weight: 800; }
.drawer-close { background: none; border: 1px solid var(--border); color: var(--text2); cursor: pointer; font-size: 16px; width: 30px; height: 30px; border-radius: 7px; display: flex; align-items: center; justify-content: center; transition: all var(--t); }
.drawer-close:hover { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.3); color: var(--red); }

/* ── Modal ───────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 300;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); backdrop-filter: blur(24px);
  border: 1px solid var(--border2); border-radius: var(--r);
  padding: 26px; width: 480px; max-width: 92vw; max-height: 90vh; overflow-y: auto;
  animation: modal-in 0.18s ease;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
}
@keyframes modal-in { from{opacity:0;transform:scale(0.96)} to{opacity:1;transform:scale(1)} }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; font-weight: 800; }
.modal-close { background: none; border: 1px solid var(--border); color: var(--text2); cursor: pointer; font-size: 16px; width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; transition: all var(--t); }
.modal-close:hover { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.3); color: var(--red); }

/* ── Toast ───────────────────────────────────────────────────────── */
#toast-container { position: fixed; top: 18px; right: 18px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 11px 16px; border-radius: var(--rs); font-size: 13px; font-weight: 600;
  animation: toast-in 0.22s ease; backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.5); max-width: 320px;
  border: 1px solid var(--border);
}
.toast-success { background: rgba(16,185,129,0.12);  border-color: rgba(16,185,129,0.3);  color: var(--green); }
.toast-error   { background: rgba(239,68,68,0.12);   border-color: rgba(239,68,68,0.3);   color: var(--red); }
.toast-info    { background: rgba(59,130,246,0.12);  border-color: rgba(59,130,246,0.3);  color: var(--blue); }
@keyframes toast-in { from{opacity:0;transform:translateX(24px)} to{opacity:1;transform:translateX(0)} }

/* ── Tabs ────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tab {
  padding: 9px 15px; font-size: 13px; font-weight: 600; cursor: pointer;
  color: var(--text2); border-bottom: 2px solid transparent;
  transition: all var(--t); margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: #a78bfa; border-bottom-color: var(--accent); }

/* ── Progress bar ────────────────────────────────────────────────── */
.progress-bar-wrap { background: var(--surface2); border-radius: 20px; height: 6px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--accent), var(--blue)); transition: width 0.5s ease; }

/* ── Code blocks ─────────────────────────────────────────────────── */
pre, .code-block {
  background: rgba(0,0,0,0.45); border: 1px solid var(--border);
  border-radius: var(--rs); padding: 16px;
  font-family: var(--mono); font-size: 12px;
  overflow: auto; white-space: pre-wrap; word-break: break-all;
  color: rgba(230,230,240,0.85); line-height: 1.65; max-height: 400px;
}
.diff-add    { color: var(--green); }
.diff-remove { color: var(--red); }
.diff-header { color: var(--blue); font-weight: 600; }

/* ── Loading / Empty States ──────────────────────────────────────── */
.spinner {
  width: 30px; height: 30px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.75s linear infinite; margin: auto;
}
@keyframes spin { to{transform:rotate(360deg)} }
.empty-state { text-align: center; padding: 64px 20px; color: var(--text3); }
.empty-state .empty-icon { font-size: 44px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text2); margin-bottom: 8px; }
.empty-state p  { font-size: 13px; margin-bottom: 20px; }
.loading-state  { display: flex; align-items: center; justify-content: center; padding: 60px; flex-direction: column; gap: 14px; }
.loading-state p { color: var(--text2); font-size: 13px; }

/* ── Section titles ──────────────────────────────────────────────── */
.section-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }

/* ── Key display ─────────────────────────────────────────────────── */
.key-reveal {
  font-family: var(--mono); font-size: 12px;
  background: rgba(0,0,0,0.4); border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--rs); padding: 12px 14px; word-break: break-all;
  color: var(--green); margin-bottom: 12px;
}

/* ── Tags ────────────────────────────────────────────────────────── */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 11px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text2);
  margin: 2px;
}

/* ── Grid layouts ────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr;       gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }

/* ── Usage bars ──────────────────────────────────────────────────── */
.usage-bar-label { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; }
.usage-bar-wrap  { background: var(--surface2); border-radius: 20px; height: 5px; overflow: hidden; margin-bottom: 14px; }
.usage-bar-fill  { height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--accent), var(--blue)); transition: width 0.5s; }

/* ── Pricing cards ───────────────────────────────────────────────── */
.pricing-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 22px; }
.pricing-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.pricing-card.featured { border-color: rgba(124,58,237,0.4); background: rgba(124,58,237,0.06); }
.pricing-name  { font-size: 15px; font-weight: 700; }
.pricing-price { font-size: 28px; font-weight: 800; font-family: var(--mono); }
.pricing-price span { font-size: 13px; font-weight: 400; color: var(--text2); }
.pricing-feature { font-size: 13px; color: var(--text2); display: flex; align-items: center; gap: 8px; }
.pricing-feature::before { content: '✓'; color: var(--green); font-weight: 700; }

/* ── Table container ─────────────────────────────────────────────── */
.table-container { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }

/* ── Alert / Warning ─────────────────────────────────────────────── */
.alert { padding: 11px 15px; border-radius: var(--rs); font-size: 13px; margin-bottom: 14px; }
.alert-warning { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.3); color: var(--amber); }
.alert-success { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.3); color: var(--green); }
.alert-danger  { background: rgba(239,68,68,0.08);  border: 1px solid rgba(239,68,68,0.3);  color: var(--red); }

/* ── Job detail ──────────────────────────────────────────────────── */
.job-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; gap: 16px; }
.job-title  { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.job-meta   { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.job-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Comments ────────────────────────────────────────────────────── */
.comment { padding: 13px; border-radius: var(--rs); background: var(--surface2); border: 1px solid var(--border); margin-bottom: 9px; }
.comment-header { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 11px; color: var(--text3); }
.comment-body   { font-size: 13px; color: var(--text); }

/* ── Artifacts ───────────────────────────────────────────────────── */
.artifact-row { display: flex; align-items: center; justify-content: space-between; padding: 10px; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 7px; }
.artifact-name { font-size: 12px; font-family: var(--mono); }
.artifact-size { font-size: 11px; color: var(--text3); }

/* ── Toggle ──────────────────────────────────────────────────────── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 13px; color: var(--text2); }
.toggle {
  position: relative; width: 38px; height: 21px; border-radius: 11px;
  background: var(--border); cursor: pointer; transition: background var(--t); border: none;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: ''; position: absolute; top: 2.5px; left: 2.5px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  transition: transform var(--t);
}
.toggle.on::after { transform: translateX(17px); }

/* ── Danger Zone ─────────────────────────────────────────────────── */
.danger-zone { border: 1px solid rgba(239,68,68,0.3); border-radius: var(--r); padding: 20px; margin-top: 24px; }
.danger-zone h3 { color: var(--red); margin-bottom: 12px; font-size: 15px; font-weight: 700; }

/* ── Mobile hamburger ────────────────────────────────────────────── */
.hamburger {
  display: none; position: fixed; top: 14px; left: 14px; z-index: 150;
  width: 38px; height: 38px; border-radius: 9px;
  background: rgba(9,9,16,0.92); border: 1px solid var(--border);
  backdrop-filter: blur(12px); cursor: pointer;
  align-items: center; justify-content: center; font-size: 17px;
}

/* ── Announcement Banner ─────────────────────────────────────────── */
.announcement-banner {
  padding: 10px 20px;
  background: rgba(124,58,237,0.08); border-bottom: 1px solid rgba(124,58,237,0.2);
  font-size: 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.announcement-banner a { color: #a78bfa; text-decoration: underline; }
.announcement-banner button { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 16px; }

/* ── Skeleton ────────────────────────────────────────────────────── */
@keyframes skeleton-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 1200px 100%;
  animation: skeleton-shimmer 1.6s infinite linear;
  border-radius: 6px; display: block;
}
.skeleton-sm  { height: 12px; }
.skeleton-md  { height: 16px; }
.skeleton-lg  { height: 22px; }
.skeleton-xl  { height: 32px; }
.skeleton-xxl { height: 44px; }
.skeleton-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; }
.skeleton-circle { border-radius: 50% !important; }
.skeleton-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.035); }
.skeleton-row:last-child { border-bottom: none; }
.skeleton-table-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }

/* ── Feedback FAB ────────────────────────────────────────────────── */
.feedback-fab {
  position: fixed; bottom: 22px; right: 22px;
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  border: none; cursor: pointer; font-size: 22px;
  box-shadow: 0 8px 28px rgba(124,58,237,0.4);
  transition: all 0.25s ease; z-index: 200;
}
.feedback-fab:hover { transform: scale(1.1); box-shadow: 0 12px 36px rgba(124,58,237,0.5); }
.feedback-modal-content { width: 520px; }

.screenshot-preview { position: relative; display: inline-block; margin-top: 8px; }
.screenshot-preview img { max-width: 100%; max-height: 200px; border-radius: 8px; border: 1px solid var(--border); }
.btn-remove-screenshot {
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(239,68,68,0.9); border: none;
  color: #fff; cursor: pointer; font-size: 14px; line-height: 1;
}

.system-info-display { display: flex; flex-wrap: wrap; gap: 8px; }
.info-badge {
  padding: 3px 10px; border-radius: 20px;
  background: rgba(124,58,237,0.12); border: 1px solid rgba(124,58,237,0.25);
  font-size: 11px; color: var(--text2);
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* ── Org Settings ────────────────────────────────────────────────── */
.org-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 9px 15px; font-size: 13px; font-weight: 600; color: var(--text2);
  cursor: pointer; transition: color var(--t), border-color var(--t); white-space: nowrap;
}
.org-tab:hover { color: var(--text); }
.org-tab.active { color: #a78bfa; border-bottom-color: var(--accent); }
.org-tab-panel { animation: fadeIn 0.15s ease; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.org-setting-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); }
.org-setting-row:last-child { border-bottom: none; }
.org-toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.org-toggle input { opacity: 0; width: 0; height: 0; }
.org-toggle-slider {
  position: absolute; cursor: pointer; top:0; left:0; right:0; bottom:0;
  background: rgba(255,255,255,0.1); border-radius: 22px; transition: background var(--t);
}
.org-toggle-slider:before {
  content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: transform var(--t);
}
.org-toggle input:checked + .org-toggle-slider { background: var(--accent); }
.org-toggle input:checked + .org-toggle-slider:before { transform: translateX(18px); }

/* ── Tour tooltip ────────────────────────────────────────────────── */
.tour-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: none; }
.tour-overlay.active { display: block; }
.tour-tooltip {
  position: fixed; background: var(--surface);
  border: 1px solid var(--border2); border-radius: var(--r);
  padding: 20px; width: 320px; max-width: 90vw; z-index: 1001;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  backdrop-filter: blur(20px); display: none;
}
.tour-tooltip.active { display: block; animation: tour-in 0.2s ease; }
@keyframes tour-in { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
.tour-content h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.tour-content p  { font-size: 13px; color: var(--text2); margin-bottom: 12px; line-height: 1.5; }
.tour-highlight  { background: rgba(124,58,237,0.12); border: 1px solid rgba(124,58,237,0.3); border-radius: 8px; padding: 10px 12px; font-size: 12px; color: var(--text2); }
.tour-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.tour-btn { padding: 7px 15px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all var(--t); border: none; }
.tour-btn-skip { background: transparent; color: var(--text3); border: 1px solid var(--border); }
.tour-btn-skip:hover { color: var(--text2); }
.tour-btn-next { background: var(--accent); color: #fff; flex: 1; }
.tour-btn-next:hover { background: #6d28d9; }

/* ── Trajectory / Apex pipeline ──────────────────────────────────── */
.traj-wrap { margin-top: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }

.traj-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.traj-header-left { display: flex; flex-direction: column; gap: 3px; }
.traj-title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text2); }
.traj-subtitle { font-size: 11px; color: var(--text3); font-family: var(--mono); }

.traj-pct-ring { position: relative; width: 44px; height: 44px; flex-shrink: 0; }
.traj-pct-ring svg { width: 44px; height: 44px; }
.traj-pct-ring span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; font-family: var(--mono); color: var(--text);
}

.traj-timeline { padding: 14px 20px 18px; display: flex; flex-direction: column; }

.traj-step { display: flex; align-items: stretch; gap: 14px; }

.traj-node-col { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; width: 28px; }
.traj-node {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border2); background: var(--surface3);
  font-size: 11px; transition: all 0.25s; z-index: 1;
}
.traj-node svg { width: 13px; height: 13px; }
.traj-connector { width: 2px; flex: 1; min-height: 10px; background: var(--border); margin: 2px 0; border-radius: 1px; }
.traj-step-num { font-size: 10px; font-weight: 700; font-family: var(--mono); color: var(--text3); }

.traj-done    .traj-node { border-color: var(--green); background: rgba(16,185,129,0.12); color: var(--green); }
.traj-done    .traj-connector { background: rgba(16,185,129,0.3); }
.traj-running .traj-node { border-color: var(--accent); background: rgba(124,58,237,0.15); animation: traj-node-glow 2s ease-in-out infinite; }
.traj-pending .traj-node { opacity: 0.4; }

@keyframes traj-node-glow {
  0%,100% { box-shadow: 0 0 0 0 rgba(124,58,237,0); }
  50%      { box-shadow: 0 0 0 5px rgba(124,58,237,0.2); }
}

.traj-dot-pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: traj-dot 1.4s ease-in-out infinite;
}
@keyframes traj-dot { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(0.65)} }

.traj-row-body {
  flex: 1; display: flex; align-items: center; gap: 12px;
  padding: 8px 13px; border-radius: var(--rs);
  background: var(--surface2); border: 1px solid var(--border);
  border-left-width: 3px; transition: all 0.2s; min-width: 0;
}
.traj-row-gap { margin-bottom: 7px; }

.traj-done    .traj-row-body { border-left-color: var(--green); }
.traj-running .traj-row-body { border-left-color: var(--accent); box-shadow: 0 0 14px rgba(124,58,237,0.12); }
.traj-pending .traj-row-body { border-left-color: var(--border); opacity: 0.48; }
.traj-failed  .traj-row-body { border-left-color: var(--red); }

.traj-icon-box {
  width: 32px; height: 32px; border-radius: var(--rx); background: var(--surface3);
  display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0;
}
.traj-info { flex: 1; min-width: 0; }
.traj-label   { font-size: 13px; font-weight: 600; color: var(--text); }
.traj-summary { font-size: 11px; color: var(--text3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.traj-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px; flex-shrink: 0; font-family: var(--mono);
}
.traj-badge-done    { background: rgba(16,185,129,0.12); color: var(--green); }
.traj-badge-running { background: rgba(124,58,237,0.14); color: var(--accent); animation: traj-dot 1.4s ease-in-out infinite; }
.traj-badge-pending { background: rgba(255,255,255,0.04); color: var(--text3); }
.traj-badge-failed  { background: rgba(239,68,68,0.12); color: var(--red); }

/* ── Autonomy mode ───────────────────────────────────────────────── */
.ams-info-panel { margin-top: 14px; }
.ams-info-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 14px; }
.ams-info-card { display: flex; gap: 12px; padding: 14px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; }
.ams-info-icon { font-size: 22px; flex-shrink: 0; width: 32px; text-align: center; padding-top: 2px; }
.ams-info-title { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.ams-info-desc  { font-size: 12px; color: var(--text2); line-height: 1.5; }
.ams-info-list  { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.ams-info-list li { font-size: 11px; color: var(--text3); }
.ams-current-job-note { padding: 11px 14px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; }

/* ── Self-Hosted Console ─────────────────────────────────────────── */
.resource-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 12px; margin-top: 10px; }
.resource-item { background: var(--surface2); border: 1px solid var(--border); border-radius: 9px; padding: 14px; text-align: center; }
.resource-label { font-size: 11px; color: var(--text2); margin-bottom: 5px; }
.resource-value { font-size: 17px; font-weight: 700; font-family: var(--mono); }
.license-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.license-row:last-child { border-bottom: none; }
.license-label { color: var(--text2); font-size: 13px; }
.license-value { font-weight: 600; }
.license-value.valid   { color: var(--green); }
.license-value.invalid { color: var(--red); }
.offline-status { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--surface2); border-radius: 8px; }
.status-indicator { width: 9px; height: 9px; border-radius: 50%; }
.status-indicator.active   { background: var(--green); box-shadow: 0 0 7px var(--green); }
.status-indicator.inactive { background: var(--text3); }

/* ── Onboarding ──────────────────────────────────────────────────── */
.welcome-modal-header { text-align: center; padding-bottom: 18px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.welcome-logo { font-size: 44px; margin-bottom: 10px; }
.welcome-modal-header h2 {
  font-size: 22px; font-weight: 800; margin-bottom: 8px;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.welcome-subtitle { font-size: 13px; color: var(--text2); }
.welcome-features { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.welcome-feature-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; transition: all var(--t); }
.welcome-feature-item:hover { background: var(--surface3); border-color: rgba(124,58,237,0.2); }
.welcome-feature-icon { width: 38px; height: 38px; border-radius: 9px; background: rgba(124,58,237,0.12); display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.welcome-feature-item strong { display: block; font-size: 13px; margin-bottom: 2px; font-weight: 700; }
.welcome-feature-item p { font-size: 12px; color: var(--text2); margin: 0; }
.checklist-section { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.checklist-section h3 { font-size: 13px; font-weight: 700; color: var(--text2); margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.04em; }
.checklist-items { display: flex; flex-direction: column; gap: 10px; }
.checklist-item { display: flex; align-items: center; gap: 10px; padding: 10px; background: rgba(255,255,255,0.02); border-radius: 8px; transition: all var(--t); }
.checklist-item:hover { background: rgba(255,255,255,0.04); }
.checklist-checkbox { position: relative; display: flex; align-items: center; cursor: pointer; }
.checklist-checkbox input { position: absolute; opacity: 0; width: 0; height: 0; }
.checklist-checkbox .checkmark { width: 20px; height: 20px; border: 1.5px solid var(--border); border-radius: 5px; background: transparent; transition: all var(--t); display: flex; align-items: center; justify-content: center; }
.checklist-checkbox input:checked + .checkmark { background: var(--accent); border-color: var(--accent); }
.checklist-checkbox input:checked + .checkmark::after { content: '✓'; color: #fff; font-size: 12px; font-weight: 800; }
.checklist-content { flex: 1; }
.checklist-title { display: block; font-size: 13px; font-weight: 600; margin-bottom: 1px; }
.checklist-desc  { font-size: 11px; color: var(--text3); }
.checklist-progress { margin-top: 14px; display: flex; align-items: center; gap: 10px; }
.checklist-progress-bar  { flex: 1; height: 5px; background: var(--surface3); border-radius: 3px; overflow: hidden; }
.checklist-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--blue)); border-radius: 3px; transition: width 0.3s ease; }
.checklist-progress-text { font-size: 11px; color: var(--text2); white-space: nowrap; }
.welcome-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.welcome-actions-right { display: flex; gap: 8px; }
.welcome-actions .btn { padding: 10px 18px; }

/* ── CDN / Cache panels ──────────────────────────────────────────── */
#assets-cache-status, #cdn-config-status { pointer-events: auto; }
#assets-cache-status .sacm-wrapper, #cdn-config-status .cdncp-wrapper { display: inline-block; }
.cdn-panel-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px 22px; margin-bottom: 18px; }
.cdn-panel-title   { font-size: 13px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.cdn-panel-subtitle { font-size: 12px; color: var(--text3); margin-bottom: 14px; }
.cdn-asset-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); gap: 9px; margin-top: 10px; }
.cdn-asset-card { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 11px; font-family: var(--mono); }
.cdn-asset-name { font-weight: 600; color: var(--text2); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cdn-asset-meta { color: var(--text3); font-size: 10px; }
.cdn-asset-card.cdn-asset-ok   { border-color: rgba(16,185,129,0.22); }
.cdn-asset-card.cdn-asset-miss { border-color: rgba(239,68,68,0.22); }
.cdn-cache-hint { font-size: 11px; font-family: var(--mono); background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; color: var(--green); margin-top: 8px; word-break: break-all; }

/* ── Nav active email-templates ──────────────────────────────────── */
.nav-item[data-route="/email-templates"].active { background: rgba(124,58,237,0.11); color: #a78bfa; }

/* ── Scrollbar ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .stats-row { grid-template-columns: repeat(2,1fr); }
  .pricing-grid { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form-side { width: 100%; padding: 40px 22px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hamburger { display: flex; }
  .main { padding-top: 60px; }
  .ams-info-grid { grid-template-columns: 1fr; }
}
