:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #5d6875;
  --line: #d8dee7;
  --accent: #176b87;
  --danger: #a23434;
  --ok: #2e7d4f;
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--accent);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

nav,
nav form,
.inline-form {
  display: flex;
  align-items: center;
  gap: 12px;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 32px auto;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.page-head {
  margin-bottom: 24px;
}

.page-head p,
.item p {
  color: var(--muted);
}

.login-panel {
  width: min(420px, 100%);
  margin: 80px auto;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stack {
  display: grid;
  gap: 16px;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid.two {
  grid-template-columns: 1fr 1fr;
}

.list {
  display: grid;
  gap: 12px;
}

.item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
select,
button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.danger-button {
  margin-top: 12px;
  background: var(--danger);
  border-color: var(--danger);
}

.table-scroll {
  overflow-x: auto;
}

.backup-actions {
  white-space: nowrap;
}

.backup-actions a + a {
  margin-left: 12px;
}

.backup-log {
  margin-top: 28px;
}

.report-toggle {
  margin-bottom: 16px;
}

.notice {
  padding: 12px;
  background: #e8f5ee;
  border: 1px solid #a9d4b9;
  border-radius: 6px;
}

input,
select {
  padding: 7px 10px;
  background: #fff;
  color: var(--text);
}

button {
  padding: 7px 13px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  cursor: pointer;
}

nav button {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

code {
  word-break: break-word;
}

.log-output {
  min-height: 260px;
  overflow: auto;
  padding: 16px;
  background: #101820;
  color: #e8eef5;
  border-radius: 8px;
  white-space: pre-wrap;
}

.alert {
  padding: 12px;
  background: #fff1f0;
  border: 1px solid #f0b8b8;
  border-radius: 6px;
  color: var(--danger);
}

.tag,
.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 0.82rem;
}

.status.succeeded {
  background: #e8f5ee;
  color: var(--ok);
}

.status.failed,
.status.error,
.status.timeout {
  background: #fff1f0;
  color: var(--danger);
}

.status.queued,
.status.running {
  background: #fff8e5;
  color: #8a5b00;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 14px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.meta dt {
  color: var(--muted);
}

@media (max-width: 760px) {
  .topbar,
  nav,
  .item,
  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .grid.two {
    grid-template-columns: 1fr;
  }
}
