:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #171c22;
  --sub: #626b76;
  --line: #e4e7eb;
  --accent: #2456d6;
  --accent-soft: #e9eefb;
  --ok: #10805f;
  --ok-bg: #e2f5ee;
  --warn: #965e00;
  --warn-bg: #fcf1da;
  --info: #1a5fa8;
  --info-bg: #e3effc;
  --bad: #b3261e;
  --bad-bg: #fbe7e6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 28, 34, 0.05), 0 8px 24px rgba(23, 28, 34, 0.05);
  --font:
    "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo,
    sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  min-height: 100%;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 36px 20px 64px;
}

h1,
h2,
h3 {
  margin: 0;
}

.header {
  margin-bottom: 22px;
}

.header h1 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.header p {
  margin: 6px 0 0;
  color: var(--sub);
  font-size: 0.92rem;
}

.control {
  display: grid;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

select,
input,
button {
  font: inherit;
}

button,
.btn {
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--accent);
  padding: 9px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.1s ease;
}

button:hover:not([disabled]) {
  background: #1c46b4;
}

button:active:not([disabled]) {
  transform: scale(0.97);
}

button[disabled] {
  opacity: 0.55;
  cursor: default;
}

button.ghost,
.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
}

button.ghost:hover:not([disabled]) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

input[type="text"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
  min-width: 180px;
}

select:focus,
input[type="text"]:focus,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat {
  display: grid;
  gap: 2px;
  min-width: 120px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.stat .label {
  font-size: 0.75rem;
  color: var(--sub);
  letter-spacing: 0.04em;
}

.stat .value {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat.alert .value {
  color: var(--bad);
}

.message {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--info-bg);
  color: var(--info);
  font-size: 0.88rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.panelHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.panelHead h2 {
  font-size: 1rem;
  font-weight: 700;
}

.tableWrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  vertical-align: top;
  font-size: 0.88rem;
  line-height: 1.5;
}

th:first-child,
td:first-child {
  padding-left: 18px;
}

th:last-child,
td:last-child {
  padding-right: 18px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fafbfc;
}

th {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sub);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td.num {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--sub);
  white-space: nowrap;
}

td.time {
  white-space: nowrap;
  color: var(--sub);
  font-size: 0.82rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status.pending {
  background: var(--warn-bg);
  color: var(--warn);
}
.status.running {
  background: var(--info-bg);
  color: var(--info);
}
.status.done {
  background: var(--ok-bg);
  color: var(--ok);
}
.status.failed {
  background: var(--bad-bg);
  color: var(--bad);
}

.errorNote {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--bad);
  word-break: break-word;
}

.small {
  color: var(--sub);
  font-size: 0.84rem;
}

.tableEmpty {
  padding: 32px 18px;
  text-align: center;
  color: var(--sub);
  font-size: 0.88rem;
}

@media (min-width: 1020px) {
  .grid {
    grid-template-columns: 1.1fr 1fr;
  }
}
