* { box-sizing: border-box; }
:root {
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
}
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; font-size: 15px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.appbar { display: flex; align-items: center; gap: 24px; background: #111827; color: #fff;
  padding: 10px 20px; flex-wrap: wrap; }
.appbar .brand { display: flex; flex-direction: column; line-height: 1.1; }
.appbar .brand span { font-size: 11px; color: #9ca3af; }
.appbar nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.appbar nav a { color: #d1d5db; padding: 6px 12px; border-radius: 6px; }
.appbar nav a:hover, .appbar nav a.active { background: #1f2937; color: #fff; text-decoration: none; }
.appbar .userbox { display: flex; align-items: center; gap: 10px; color: #d1d5db; font-size: 13px; }

main { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 20px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card h2 { margin: 0 0 14px; font-size: 17px; }
.card h3 { margin: 18px 0 8px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

label { display: block; margin: 10px 0 4px; font-weight: 600; font-size: 13px; }
input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font: inherit; background: #fff; }
textarea { min-height: 130px; font-family: Consolas, monospace; }
input:focus, textarea:focus, select:focus { outline: 2px solid #bfdbfe; border-color: var(--accent); }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; margin: 6px 0; cursor: pointer; font-weight: normal; }
.option input { margin-top: 3px; }
.option small { display: block; color: var(--muted); }

button { font: inherit; border: 0; border-radius: 6px; padding: 9px 16px; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 600; }
button:hover { background: var(--accent-dark); }
button:disabled { background: #9ca3af; cursor: not-allowed; }
button.secondary { background: #e5e7eb; color: var(--text); }
button.secondary:hover { background: #d1d5db; }
button.danger { background: var(--danger); }
button.compact { padding: 5px 10px; font-size: 13px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: #f9fafb; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #e5e7eb; color: #374151; white-space: nowrap; }
.badge.queued, .badge.pending { background: #e0e7ff; color: #3730a3; }
.badge.running, .badge.uploading { background: #dbeafe; color: #1d4ed8; }
.badge.completed { background: #dcfce7; color: #166534; }
.badge.retried { background: #fef9c3; color: #854d0e; }
.badge.completed_with_errors { background: #ffedd5; color: #9a3412; }
.badge.failed { background: #fee2e2; color: #991b1b; }
.badge.cancelled, .badge.skipped { background: #f3f4f6; color: #6b7280; }

.error-box { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; border-radius: 8px;
  padding: 10px 14px; margin: 10px 0; white-space: pre-wrap; }
.success-box { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; border-radius: 8px;
  padding: 10px 14px; margin: 10px 0; }
.hint { color: var(--muted); font-size: 13px; }

.loglist { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto;
  font-family: Consolas, monospace; font-size: 12.5px; background: #0f172a; color: #e2e8f0;
  border-radius: 8px; padding: 10px; }
.loglist li { padding: 1px 4px; white-space: pre-wrap; }
.loglist li.warn { color: #fbbf24; }
.loglist li.error { color: #f87171; }
.loglist .ts { color: #64748b; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }

.login-wrap { max-width: 380px; margin: 10vh auto; }
.login-wrap .logo { text-align: center; margin-bottom: 16px; }
.task-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.preview-stats { display: flex; gap: 14px; margin-top: 8px; font-size: 13px; }
.preview-stats strong { font-size: 16px; }
