:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --border: #e3e5ea;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.topbar .brand { font-weight: 700; font-size: 16px; }
.topbar nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 20px;
  font-size: 14px;
}
.topbar nav a.active, .topbar nav a:hover { color: var(--primary); }
.topbar .userinfo { font-size: 13px; color: var(--muted); }
.topbar .userinfo a { color: var(--primary); text-decoration: none; margin-left: 10px; }

.container { max-width: 860px; margin: 32px auto; padding: 0 20px; }
.container.wide { max-width: 1100px; }

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

h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 14px; }
p.subtitle { color: var(--muted); font-size: 13px; margin: 0 0 20px; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card { width: 340px; }

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; margin-top: 14px; }
input[type=text], input[type=password], input[type=number], select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

.check-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.check-row:last-child { border-bottom: none; }
.check-row input[type=checkbox] { width: 18px; height: 18px; }
.check-row .label { font-weight: 600; font-size: 14px; }
.check-row .desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

button, .btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover { background: var(--primary-dark); }
button:disabled { background: #9ca3af; cursor: not-allowed; }
button.secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); }
button.danger { background: var(--danger); }
button.small { padding: 5px 10px; font-size: 12px; }

.advanced { margin-top: 16px; }
.advanced summary { cursor: pointer; font-size: 13px; color: var(--primary); font-weight: 600; }
.advanced-body { display: flex; gap: 16px; margin-top: 12px; }
.advanced-body > div { flex: 1; }

.error { background: #fef2f2; border: 1px solid #fecaca; color: var(--danger); padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 14px; }
.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: var(--success); padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 14px; }
.warning { background: #fffbeb; border: 1px solid #fde68a; color: var(--warning); padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 14px; }

.status-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-running { background: #dbeafe; color: #1d4ed8; }
.status-success { background: #dcfce7; color: #15803d; }
.status-error { background: #fee2e2; color: #b91c1c; }
.status-blocked { background: #fef3c7; color: #92400e; }
.status-interrupted { background: #f3f4f6; color: #4b5563; }

#log-console {
  background: #0b1020;
  color: #d1d5db;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  padding: 14px;
  border-radius: 8px;
  height: 320px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 16px;
  display: none;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
tr:hover td { background: #fafafa; }
a.link { color: var(--primary); text-decoration: none; }

.tag { display: inline-block; background: #eef2ff; color: #4338ca; font-size: 11px; padding: 2px 8px; border-radius: 5px; margin-right: 4px; }
