:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1f2330;
  --border: #2a2f3d;
  --text: #e8eaf0;
  --text-dim: #9aa1b2;
  --accent: #6c8cff;
  --accent-2: #7be3b3;
  --danger: #ff6c6c;
  --warn: #ffcf6c;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

header.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

header.top h1 {
  font-size: 20px;
  margin: 0;
}

header.top nav a {
  color: var(--text-dim);
  text-decoration: none;
  margin-left: 16px;
  font-size: 14px;
}
header.top nav a:hover { color: var(--text); }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); }
.dropzone p { color: var(--text-dim); margin: 4px 0; }

input[type="file"] { display: none; }

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
button:hover { opacity: 0.9; }
button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
button.danger { background: var(--danger); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.job {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--panel-2);
}
.job-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.job-name { font-weight: 600; word-break: break-all; }
.job-meta { color: var(--text-dim); font-size: 12px; margin-top: 4px; }

.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.queued { background: #333a4d; color: var(--text-dim); }
.badge.chunking, .badge.processing, .badge.postprocessing { background: #2a3a5c; color: var(--accent); }
.badge.done { background: #1e3a2e; color: var(--accent-2); }
.badge.error { background: #3a1f1f; color: var(--danger); }

.progress-bar {
  height: 6px;
  border-radius: 4px;
  background: #2a2f3d;
  margin-top: 10px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}

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

.login-box {
  max-width: 360px;
  margin: 80px auto 0;
}
.login-box input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  margin-bottom: 12px;
  font-size: 14px;
}
.login-box button { width: 100%; }
.error-text { color: var(--danger); font-size: 13px; margin-top: -6px; margin-bottom: 12px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.field input[type="text"], .field input[type="password"], .field input[type="number"] {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
}
.field .hint { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.switch-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  display: none;
}
