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

:root {
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Fira Code', monospace;

  /* Colors */
  --bg: #0F1117;
  --bg2: #161B27;
  --bg3: #1E2535;
  --bg4: #252D3D;
  --border: rgba(255, 255, 255, 0.07);
  --border2: rgba(255, 255, 255, 0.12);

  --text: #F0F2F7;
  --text2: #9BA6BE;
  --text3: #636D87;

  --indigo: #6366F1;
  --indigo-hover: #818CF8;
  --indigo-dim: rgba(99, 102, 241, 0.15);

  --green: #22C55E;
  --green-dim: rgba(34, 197, 94, 0.12);
  --amber: #F59E0B;
  --amber-dim: rgba(245, 158, 11, 0.12);
  --red: #EF4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --purple: #A855F7;
  --purple-dim: rgba(168, 85, 247, 0.12);

  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-w: 220px;
  --content-max: 1200px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── App Layout ─────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.app.landing-mode {
  grid-template-columns: 1fr;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 20px 12px;
  z-index: 100;
}

.sidebar-top {
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  margin-bottom: 20px;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  background: var(--bg3);
  border-radius: var(--radius);
  margin-bottom: 4px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.user-info-mini {
  overflow: hidden;
}

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

.user-email {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--text2);
  font-size: 13.5px;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  width: 100%;
}

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

.nav-item.active {
  background: var(--indigo-dim);
  color: var(--indigo-hover);
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item.active svg {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
}

.nav-badge.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.sidebar-bottom {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.api-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text3);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text3);
  flex-shrink: 0;
}

.status-dot.ok,
.status-dot.green {
  background: var(--green);
  box-shadow: 0 0 0 2px var(--green-dim);
}

.status-dot.error {
  background: var(--red);
}

.sign-out-btn {
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text2);
  font-size: 12.5px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
}

.sign-out-btn:hover {
  background: var(--red-dim);
  color: var(--red);
  border-color: var(--red);
}

/* ── Main Content ─────────────────────────────────────────────── */
.content {
  overflow-y: auto;
  min-height: 100vh;
  padding: 32px;
  max-width: var(--content-max);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

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

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.page-sub {
  font-size: 13.5px;
  color: var(--text2);
  margin-top: 3px;
}

.hdr-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: var(--indigo);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--indigo-hover);
}

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

.btn-primary.full {
  width: 100%;
  justify-content: center;
}

.btn-primary.small {
  padding: 6px 12px;
  font-size: 12.5px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-ghost:hover {
  background: var(--bg3);
  color: var(--text);
}

.btn-ghost.full {
  width: 100%;
  justify-content: center;
}

.btn-ghost.small {
  padding: 6px 12px;
  font-size: 12.5px;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  background: transparent;
  color: var(--indigo-hover);
  border: 1px solid var(--indigo);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-outline:hover {
  background: var(--indigo-dim);
}

.btn-outline.full {
  width: 100%;
}

/* ── Auth Modal ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

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

.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 380px;
  position: relative;
}

.modal-dismiss {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}

.modal-dismiss:hover {
  color: var(--text);
}

.modal-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.modal-sub {
  font-size: 13.5px;
  color: var(--text2);
  margin-bottom: 24px;
}

.auth-error {
  background: var(--red-dim);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--red);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.field input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--font-sans);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.field input:focus {
  border-color: var(--indigo);
}

.field input::placeholder {
  color: var(--text3);
}

.auth-switch {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text2);
}

.link {
  color: var(--indigo-hover);
  cursor: pointer;
  font-weight: 500;
}

.link:hover {
  text-decoration: underline;
}

/* ── Auth Gate ─────────────────────────────────────────────── */
.auth-gate {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  max-width: 520px;
  margin: 40px auto;
}

.gate-icon {
  margin-bottom: 20px;
}

.auth-gate h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.auth-gate p {
  color: var(--text2);
  margin-bottom: 28px;
}

.gate-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.feature-item {
  font-size: 13.5px;
  color: var(--text2);
}

.feat-check {
  color: var(--green);
  font-weight: 700;
  margin-right: 8px;
}

/* ── Stats Grid ─────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color 0.15s;
}

.stat-card:hover {
  border-color: var(--border2);
}

.stat-card.danger {
  border-left: 3px solid var(--red);
}

.stat-card.warning {
  border-left: 3px solid var(--amber);
}

.stat-card.success {
  border-left: 3px solid var(--green);
}

.stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1px;
}

.stat-value.small {
  font-size: 14px;
  letter-spacing: 0;
  font-weight: 500;
}

/* ── Sections ─────────────────────────────────────────────── */
.section {
  margin-bottom: 32px;
}

.section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* ── Skeleton Loaders ─────────────────────────────────────── */
.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-row {
  height: 56px;
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius);
  animation: shimmer 1.5s infinite;
}

.skeleton-row.tall {
  height: 80px;
}

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

  100% {
    background-position: -200% 0;
  }
}

/* ── Recent List (overview) ─────────────────────────────── */
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.recent-item:hover {
  border-color: var(--border2);
  background: var(--bg3);
}

.recent-repo {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.recent-meta {
  font-size: 12px;
  color: var(--text3);
  font-family: var(--font-mono);
}

.sev-chip {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.sev-high {
  background: var(--red-dim);
  color: var(--red);
}

.sev-med {
  background: var(--amber-dim);
  color: var(--amber);
}

.sev-low {
  background: var(--green-dim);
  color: var(--green);
}

/* ── Reports Layout ─────────────────────────────────────── */
.filter-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  padding-bottom: 0;
}

.tab {
  padding: 8px 14px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  font-size: 13px;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: -1px;
}

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

.tab.active {
  color: var(--text);
  border-bottom-color: var(--indigo);
}

.tab.danger.active {
  color: var(--red);
  border-bottom-color: var(--red);
}

.tab-spacer {
  flex: 1;
}

.sort-select {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text2);
  font-size: 12.5px;
  font-family: var(--font-sans);
  padding: 6px 10px;
  outline: none;
  cursor: pointer;
}

.reports-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  align-items: start;
}

.reports-list-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.list-meta {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text3);
}

.meta-text {
  font-family: var(--font-mono);
}

.reports-list {
  max-height: calc(100vh - 260px);
  overflow-y: auto;
}

.report-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.report-row:last-child {
  border-bottom: none;
}

.report-row:hover {
  background: var(--bg3);
}

.report-row.active {
  background: var(--indigo-dim);
  border-left: 3px solid var(--indigo);
}

.rr-body {
  flex: 1;
  min-width: 0;
}

.rr-repo {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.rr-meta {
  font-size: 11.5px;
  color: var(--text3);
  font-family: var(--font-mono);
}

.rr-date {
  font-size: 11px;
  color: var(--text3);
  margin-top: 3px;
}

/* ── Report Detail Panel ─────────────────────────────────── */
.report-detail-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-height: 500px;
}

.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  gap: 14px;
  color: var(--text3);
  font-size: 13.5px;
  padding: 40px;
  text-align: center;
}

.detail-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-header-left h2 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 3px;
}

.detail-header-left p {
  font-size: 12px;
  color: var(--text3);
  font-family: var(--font-mono);
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-badge {
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.detail-meta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}

.detail-meta-cell {
  background: var(--bg2);
  padding: 12px 20px;
}

.dmc-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.dmc-value {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text);
}

.detail-body {
  padding: 20px 24px;
  overflow-y: auto;
  max-height: calc(100vh - 340px);
}

.autofix-banner {
  background: var(--green-dim);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--green);
}

.autofix-link {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
}

.autofix-link:hover {
  text-decoration: underline;
}

.empty-success {
  text-align: center;
  padding: 40px;
  color: var(--green);
}

.empty-success h3 {
  font-size: 18px;
  margin: 12px 0 6px;
}

.empty-success p {
  color: var(--text2);
  font-size: 13.5px;
}

/* ── Issue Cards ─────────────────────────────────────────── */
.issue-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.issue-card:hover {
  border-color: var(--border2);
}

.issue-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.type-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.type-security {
  background: var(--purple-dim);
  color: var(--purple);
}

.type-error {
  background: var(--red-dim);
  color: var(--red);
}

.type-warning {
  background: var(--amber-dim);
  color: var(--amber);
}

.type-dependency {
  background: var(--indigo-dim);
  color: var(--indigo-hover);
}

.issue-loc {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text2);
}

.issue-tool {
  margin-left: auto;
  font-size: 11px;
  background: var(--bg4);
  color: var(--text3);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.issue-msg {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
}

.ai-block {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 14px 16px;
}

.ai-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--indigo-hover);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--indigo);
  border-radius: 50%;
}

.ai-line {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 8px;
  line-height: 1.6;
}

.ai-line strong {
  color: var(--text);
  font-weight: 600;
}

.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--green);
  overflow-x: auto;
  white-space: pre;
  margin-top: 8px;
  line-height: 1.6;
}

/* ── Jobs ────────────────────────────────────────────────── */
.jobs-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.job-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 8px 1fr auto auto;
  align-items: center;
  gap: 16px;
  transition: border-color 0.15s;
}

.job-card:hover {
  border-color: var(--border2);
}

.job-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.job-pending .job-indicator {
  background: var(--amber);
}

.job-processing .job-indicator {
  background: var(--indigo);
  animation: pulse 1s infinite;
}

.job-done .job-indicator {
  background: var(--green);
}

.job-failed .job-indicator {
  background: var(--red);
}

.job-repo {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.job-meta {
  font-size: 12px;
  color: var(--text3);
  font-family: var(--font-mono);
}

.job-status {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text3);
  background: var(--bg3);
  padding: 2px 8px;
  border-radius: 4px;
}

.job-action {
  font-size: 13px;
  color: var(--indigo);
  text-decoration: none;
  font-weight: 500;
}

.btn-cancel {
  background: var(--red-faint);
  color: var(--red);
  border: 1px solid var(--red-dim);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-cancel:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

.job-err {
  font-size: 11px;
  color: var(--red);
  margin-top: 4px;
}

.job-err {
  font-size: 12px;
  color: var(--red);
  margin-top: 3px;
}

.job-status {
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.job-pending .job-status {
  background: var(--amber-dim);
  color: var(--amber);
}

.job-processing .job-status {
  background: var(--indigo-dim);
  color: var(--indigo-hover);
}

.job-done .job-status {
  background: var(--green-dim);
  color: var(--green);
}

.job-failed .job-status {
  background: var(--red-dim);
  color: var(--red);
}

.job-action {
  color: var(--indigo-hover);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.job-action:hover {
  text-decoration: underline;
}

/* ── Setup Page ─────────────────────────────────────────── */
.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.setup-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.setup-card-hdr {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.setup-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.setup-icon.indigo {
  background: var(--indigo);
}

.setup-icon.purple {
  background: var(--purple);
}

.setup-icon.green {
  background: var(--green);
}

.setup-icon.amber {
  background: var(--amber);
}

.setup-card-hdr h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.setup-card-hdr p {
  font-size: 12.5px;
  color: var(--text2);
}

.url-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.url-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text2);
  outline: none;
}

.hint-text {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.5;
}

.hint-text code {
  font-family: var(--font-mono);
  background: var(--bg3);
  padding: 1px 5px;
  border-radius: 4px;
}

.hint-text a {
  color: var(--indigo-hover);
}

.steps {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.steps li {
  font-size: 13.5px;
  color: var(--text2);
  line-height: 1.5;
}

.steps li strong {
  color: var(--text);
}

.steps li code {
  font-family: var(--font-mono);
  background: var(--bg3);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.connected-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13.5px;
  color: var(--text2);
}

.connected-badge strong {
  color: var(--text);
}

.flow-steps {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.flow-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px;
  background: var(--bg3);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text2);
}

.flow-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--indigo);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.flow-arrow {
  text-align: center;
  color: var(--text3);
  font-size: 18px;
  padding: 2px 0;
}

/* ── Search ─────────────────────────────────────────────── */
.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
}

.search-input {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 8px 12px 8px 32px;
  font-size: 13.5px;
  font-family: var(--font-sans);
  color: var(--text);
  outline: none;
  width: 240px;
  transition: border-color 0.15s;
}

.search-input:focus {
  border-color: var(--indigo);
}

.search-input::placeholder {
  color: var(--text3);
}

/* ── Utilities ─────────────────────────────────────────── */
.hidden {
  display: none !important;
}

/* ── Empty States ────────────────────────────────────────── */
.empty-state {
  padding: 48px 32px;
  text-align: center;
  color: var(--text3);
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13.5px;
}

/* ── Scrollbars ──────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg4);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text3);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .reports-layout {
    grid-template-columns: 1fr;
  }

  .setup-grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 20px 16px;
  }
}

@media (max-width: 600px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .detail-meta-row {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
  }
}  .page-header {
    flex-direction: column;
  }
}

/* ── Landing Page ────────────────────────────────────────── */
#pageLanding {
  max-width: 100%;
  padding: 0;
  overflow-x: hidden;
}

.gradient-text {
  background: linear-gradient(135deg, #6366F1 0%, #A855F7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Hero Section */
.hero {
  padding: 100px 24px;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.1), transparent),
              radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.05), transparent);
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 60px;
}

.hero-badge {
  display: inline-block;
  background: var(--indigo-dim);
  color: var(--indigo);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hero-title {
  font-size: 56px;
  line-height: 1.1;
  font-weight: 800;
  margin-bottom: 24px;
  letter-spacing: -2px;
}

.hero-desc {
  font-size: 18px;
  color: var(--text2);
  margin-bottom: 40px;
  max-width: 500px;
}

.hero-btns {
  display: flex;
  gap: 16px;
}

.btn-primary.lg {
  padding: 14px 32px;
  font-size: 16px;
}

.btn-ghost.lg {
  padding: 14px 32px;
  font-size: 16px;
}

/* Mockup Visual */
.mockup-window {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.mockup-header {
  background: var(--bg3);
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.m-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.m-dot.red { background: #FF5F56; }
.m-dot.amber { background: #FFBD2E; }
.m-dot.green { background: #27C93F; }

.mockup-content {
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.m-line { margin-bottom: 6px; }
.m-line.indent { padding-left: 24px; }
.m-keyword { color: #C678DD; }
.m-func { color: #61AFEF; }
.m-comment { color: #5C6370; }
.m-err { color: #E06C75; text-decoration: underline wavy; }
.m-code { background: var(--bg4); padding: 2px 4px; border-radius: 4px; }

.m-ai-box {
  margin-top: 20px;
  background: var(--bg3);
  border: 1px solid var(--indigo-dim);
  border-left: 3px solid var(--indigo);
  padding: 16px;
  border-radius: 4px;
  animation: slideInUp 0.5s ease-out both;
  animation-delay: 1s;
}

.m-ai-header {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--indigo);
  font-size: 11px;
}

.m-ai-body { color: var(--text2); margin-bottom: 12px; }
.m-ai-btn {
  background: var(--indigo);
  color: white;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}

/* Features Section */
.features-section {
  padding: 100px 24px;
  background: var(--bg);
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 64px;
}

.section-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 16px;
}

.section-sub {
  font-size: 16px;
  color: var(--text3);
}

.features-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
}

.feature-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 40px 32px;
  border-radius: var(--radius-lg);
  transition: transform 0.2s, border-color 0.2s;
}

.feature-item:hover {
  transform: translateY(-5px);
  border-color: var(--indigo-dim);
}

.feature-icon-box {
  font-size: 32px;
  margin-bottom: 24px;
}

.feature-item h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

.feature-item p {
  color: var(--text3);
  font-size: 14px;
}

/* CTA Banner */
.cta-banner {
  padding: 80px 24px;
  text-align: center;
}

.cta-inner {
  max-width: 800px;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--bg2) 0%, var(--bg3) 100%);
  border: 1px solid var(--border2);
  padding: 60px;
  border-radius: 24px;
}

.cta-inner h2 {
  font-size: 32px;
  margin-bottom: 16px;
}

.cta-inner p {
  color: var(--text3);
  margin-bottom: 32px;
}

/* Animations */
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1000px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-desc { margin: 0 auto 40px; }
  .hero-btns { justify-content: center; }
  .hero-title { font-size: 40px; }
}

/* -- Landing Page ------------------------------------------ */
#pageLanding {
  max-width: 100%;
  padding: 0;
  overflow-x: hidden;
}

.gradient-text {
  background: linear-gradient(135deg, #6366F1 0%, #A855F7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Hero Section */
.hero {
  padding: 100px 24px;
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.1), transparent),
              radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.05), transparent);
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 60px;
}

.hero-badge {
  display: inline-block;
  background: var(--indigo-dim);
  color: var(--indigo);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hero-title {
  font-size: 56px;
  line-height: 1.1;
  font-weight: 800;
  margin-bottom: 24px;
  letter-spacing: -2px;
}

.hero-desc {
  font-size: 18px;
  color: var(--text2);
  margin-bottom: 40px;
  max-width: 500px;
}

.hero-btns {
  display: flex;
  gap: 16px;
}

.btn-primary.lg {
  padding: 14px 32px;
  font-size: 16px;
}

.btn-ghost.lg {
  padding: 14px 32px;
  font-size: 16px;
}

/* Mockup Visual */
.mockup-window {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.mockup-header {
  background: var(--bg3);
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.m-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.m-dot.red { background: #FF5F56; }
.m-dot.amber { background: #FFBD2E; }
.m-dot.green { background: #27C93F; }

.mockup-content {
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.m-line { margin-bottom: 6px; }
.m-line.indent { padding-left: 24px; }
.m-keyword { color: #C678DD; }
.m-func { color: #61AFEF; }
.m-comment { color: #5C6370; }
.m-err { color: #E06C75; text-decoration: underline wavy; }
.m-code { background: var(--bg4); padding: 2px 4px; border-radius: 4px; }

.m-ai-box {
  margin-top: 20px;
  background: var(--bg3);
  border: 1px solid var(--indigo-dim);
  border-left: 3px solid var(--indigo);
  padding: 16px;
  border-radius: 4px;
  animation: slideInUp 0.5s ease-out both;
  animation-delay: 1s;
}

.m-ai-header {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--indigo);
  font-size: 11px;
}

.m-ai-body { color: var(--text2); margin-bottom: 12px; }
.m-ai-btn {
  background: var(--indigo);
  color: white;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}

/* Features Section */
.features-section {
  padding: 100px 24px;
  background: var(--bg);
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 64px;
}

.section-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 16px;
}

.section-sub {
  font-size: 16px;
  color: var(--text3);
}

.features-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
}

.feature-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 40px 32px;
  border-radius: var(--radius-lg);
  transition: transform 0.2s, border-color 0.2s;
}

.feature-item:hover {
  transform: translateY(-5px);
  border-color: var(--indigo-dim);
}

.feature-icon-box {
  font-size: 32px;
  margin-bottom: 24px;
}

.feature-item h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

.feature-item p {
  color: var(--text3);
  font-size: 14px;
}

/* CTA Banner */
.cta-banner {
  padding: 80px 24px;
  text-align: center;
}

.cta-inner {
  max-width: 800px;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--bg2) 0%, var(--bg3) 100%);
  border: 1px solid var(--border2);
  padding: 60px;
  border-radius: 24px;
}

.cta-inner h2 {
  font-size: 32px;
  margin-bottom: 16px;
}

.cta-inner p {
  color: var(--text3);
  margin-bottom: 32px;
}

/* Animations */
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1000px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-desc { margin: 0 auto 40px; }
  .hero-btns { justify-content: center; }
  .hero-title { font-size: 40px; }
}
