:root {
  --bg-1: #090a0f;
  --bg-2: #12141c;
  --panel: rgba(18, 20, 29, 0.82);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f3f4f6;
  --muted: #9ca3af;
  --accent: #d2fd3b;
  --cyan: #38bdf8;
  --green: #34d399;
  --err: #f43f5e;
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: radial-gradient(1000px 500px at 50% -10%, rgba(210, 253, 59, 0.08), transparent 70%),
    radial-gradient(800px 400px at 90% 90%, rgba(56, 189, 248, 0.05), transparent 70%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
}

.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  padding: 24px;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(210, 253, 59, 0.12);
  border: 1px solid rgba(210, 253, 59, 0.3);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  margin-bottom: 6px;
}

.b2-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green);
}

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

h1 {
  margin: 4px 0 0;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.04em;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.1;
  color: #fff;
}

.sub {
  margin: 12px 0 0;
  color: var(--muted);
  max-width: 78ch;
  line-height: 1.5;
  font-size: 0.95rem;
}

.modes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.mode {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: var(--radius-lg);
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.mode.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(210, 253, 59, 0.3);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  display: block;
}

.hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}

.hint code {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
}

.input,
.textarea {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.input:focus,
.textarea:focus {
  border-color: var(--accent);
}

.input.file {
  padding: 10px;
  cursor: pointer;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  border-radius: var(--radius-md);
  padding: 12px 24px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn.primary {
  background: var(--accent);
  color: #000;
  box-shadow: 0 4px 16px rgba(210, 253, 59, 0.25);
}

.btn.primary:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn.danger {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--err);
}

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

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

.stat-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
}

.text-cyan {
  color: var(--cyan);
}

.text-green {
  color: var(--green);
}

.text-accent {
  color: var(--accent);
}

.progress-wrap {
  width: 100%;
  height: 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--accent));
  transition: width 0.3s ease;
}

.active-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.creator-badge {
  background: rgba(210, 253, 59, 0.15);
  border: 1px solid rgba(210, 253, 59, 0.3);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
}

.current {
  margin: 0;
  font-size: 0.88rem;
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-row {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  margin-bottom: 16px;
}

.logs-header {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 8px;
}

.logs {
  background: #050608;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  height: 240px;
  overflow-y: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.6;
}

.log-line {
  word-break: break-all;
}

.hidden {
  display: none !important;
}


/* --- Creator Ingestion Monitor Dashboard --- */
.creators-section {
  margin: 18px 0;
  background: rgba(10, 12, 18, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.creators-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.creators-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.creators-title h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.creators-count-badge {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
}

.creator-search-input {
  background: rgba(18, 20, 29, 0.9);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  width: 240px;
  outline: none;
  transition: border-color 0.2s;
}

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

.creators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.creators-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px;
  color: var(--muted);
  font-size: 0.85rem;
}

.creator-card {
  background: rgba(22, 26, 38, 0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.15s, border-color 0.15s;
}

.creator-card.ingesting {
  border-color: rgba(210, 253, 59, 0.4);
  background: rgba(210, 253, 59, 0.05);
}

.creator-card.completed {
  border-color: rgba(52, 211, 153, 0.4);
}

.creator-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.creator-avatar-wrap {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--accent);
  flex-shrink: 0;
}

.creator-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.creator-info {
  flex: 1;
  min-width: 0;
}

.creator-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.creator-status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: "JetBrains Mono", monospace;
}

.creator-status-badge.ingesting {
  background: rgba(210, 253, 59, 0.2);
  color: var(--accent);
}

.creator-status-badge.completed {
  background: rgba(52, 211, 153, 0.2);
  color: var(--green);
}

.creator-status-badge.queued {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.creator-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.creator-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.creator-bar-fill.done {
  background: var(--green);
}

.creator-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
}
