:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --text: #17202a;
  --muted: #667085;
  --border: #d8e0ea;
  --accent: #0f766e;
  --accent-hover: #0b5f59;
  --danger: #b42318;
  --success: #047857;
  --warning: #b45309;
  --shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand strong {
  font-size: 17px;
}

.brand span {
  color: var(--muted);
  font-size: 13px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 44px;
}

.grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
  align-items: start;
}

.panel,
.table-panel,
.login-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  padding: 26px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: 26px;
  margin-bottom: 8px;
}

h2 {
  font-size: 18px;
  margin-bottom: 14px;
}

h3 {
  font-size: 15px;
}

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

.small {
  font-size: 13px;
}

.form-stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 11px;
  font: inherit;
  font-size: 15px;
  background: #fff;
  color: var(--text);
}

input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
}

.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-link {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--accent);
  min-height: auto;
}

.flash {
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--surface);
}

.flash-success {
  border-color: rgba(4, 120, 87, 0.25);
  background: #ecfdf3;
  color: var(--success);
}

.flash-error {
  border-color: rgba(180, 35, 24, 0.25);
  background: #fef3f2;
  color: var(--danger);
}

.table-panel {
  overflow: hidden;
}

.table-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 740px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: var(--surface-2);
  color: #344054;
  font-size: 12px;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.status-success {
  background: #ecfdf3;
  color: var(--success);
}

.status-failed {
  background: #fef3f2;
  color: var(--danger);
}

.status-running {
  background: #fff7ed;
  color: var(--warning);
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
}

.detail-list dt {
  color: var(--muted);
  font-size: 13px;
}

.detail-list dd {
  margin: 0;
  word-break: break-word;
}

.log-box {
  background: #101828;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  overflow: auto;
  max-height: 560px;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.empty {
  padding: 22px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
