* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: #111;
  background: #fff;
}

.login-body {
  background: #f5f5f7;
}

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  text-align: left;
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 22px;
}

.login-subtitle {
  margin: 0 0 16px;
  font-size: 13px;
  color: #555;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-form button {
  align-self: flex-start;
}

.login-status {
  font-size: 12px;
  color: #444;
  min-height: 16px;
}

.login-status.error {
  color: #b00020;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

.header h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
}

.header p {
  margin: 0;
  color: #555;
  font-size: 14px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button {
  padding: 8px 12px;
  border: 1px solid #ccc;
  background: #fff;
  color: #111;
  font-size: 13px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status {
  font-size: 13px;
  color: #333;
}

input[type="text"] {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13px;
}

textarea,
input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #fff;
}

input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  font-size: 13px;
}

textarea {
  min-height: 240px;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
}

.webhook,
.payload {
  margin-top: 14px;
}

.webhook-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.webhook-url {
  flex: 1;
}

.file-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hint {
  font-size: 12px;
  color: #666;
}

h2 {
  margin: 20px 0 10px;
  font-size: 16px;
  font-weight: 700;
}

.stage-root {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.run-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 6px;
}

.run-card {
  border: 1px solid #dadce0;
  border-radius: 4px;
  padding: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.run-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 13px;
}

.run-meta {
  font-size: 12px;
  color: #444;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.run-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.run-actions button {
  font-size: 12px;
}

.empty {
  padding: 16px;
  border: 1px dashed #dadce0;
  border-radius: 4px;
  font-size: 13px;
  color: #666;
}

.stage-card {
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #fff;
}

.stage-card summary {
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stage-card summary::-webkit-details-marker {
  display: none;
}

.table-wrap {
  overflow: auto;
}

.stage-summary {
  padding: 10px 12px;
  border-top: 1px solid #dadce0;
  border-bottom: 1px solid #dadce0;
  font-size: 12px;
  color: #333;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.download-btn {
  border: 1px solid #ccc;
  background: #fff;
  color: #111;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
}

.download-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

th,
td {
  border: 1px solid #dadce0;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: anywhere;
  min-width: 140px;
  max-width: 520px;
}

th {
  position: sticky;
  top: 0;
  background: #f5f5f5;
  font-weight: 600;
}

@media (max-width: 900px) {
  .controls {
    flex-direction: column;
    align-items: flex-start;
  }
}
