:root {
  --primary: #181d26;
  --primary-active: #0d1218;
  --ink: #181d26;
  --body: #333840;
  --muted: #41454d;
  --hairline: #dddddd;
  --border-strong: #9297a0;
  --canvas: #ffffff;
  --surface-soft: #f8fafc;
  --surface-strong: #e0e2e6;
  --signature-coral: #aa2d00;
  --signature-forest: #0a2e0e;
  --signature-cream: #f5e9d4;
  --link: #1b61c9;
  --info-border: #458fff;
  --success: #006400;
  --success-border: #39bf45;
  --warning: #d9a441;
  --danger: #aa2d00;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
}

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

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

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  gap: 24px;
  height: 64px;
  justify-content: space-between;
  padding: 0 48px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: flex;
  font-size: 16px;
  font-weight: 500;
  gap: 12px;
  white-space: nowrap;
}

.mark {
  background: var(--primary);
  border-radius: 6px;
  height: 22px;
  width: 22px;
}

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

.nav a,
.link-button {
  background: transparent;
  border: 0;
  color: var(--body);
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.25;
  padding: 0;
}

.nav a.active {
  color: var(--ink);
  font-weight: 500;
}

.link-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.container {
  margin: 0;
  max-width: none;
  padding: 20px 32px;
  width: 100%;
}

.workbench-container {
  max-width: none;
}

.report-container {
  max-width: none;
  padding: 16px 24px 24px;
}

.auth-wrap {
  align-items: center;
  display: grid;
  justify-items: center;
  min-height: calc(100vh - 70px);
  padding: 48px;
}

.auth-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  margin: 0 auto;
  max-width: 408px;
  padding: 32px;
  width: 100%;
}

.auth-brand {
  border-bottom: 1px solid var(--hairline);
  margin: 0 0 24px;
  padding-bottom: 16px;
}

.auth-title {
  margin-bottom: 24px;
}

.auth-title .muted {
  margin: 8px 0 0;
}

h1,
h2 {
  color: var(--ink);
  letter-spacing: 0;
  margin: 0;
}

h1 {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.35;
}

h2 {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.5;
}

.muted {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.25;
}

.tabs {
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 24px;
  padding: 4px;
}

.tab {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--body);
  cursor: pointer;
  min-height: 38px;
}

.tab.active {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  color: var(--ink);
  font-weight: 500;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

input {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  color: var(--ink);
  min-height: 44px;
  padding: 0 16px;
  width: 100%;
}

input:focus {
  border-color: var(--info-border);
  outline: 2px solid rgba(69, 143, 255, 0.18);
}

input[type="file"] {
  align-items: center;
  display: flex;
  padding: 9px 12px;
}

.button {
  align-items: center;
  background: var(--primary);
  border: 0;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 16px;
  font-weight: 500;
  justify-content: center;
  line-height: 1.4;
  min-height: 48px;
  padding: 0 24px;
}

.button:active {
  background: var(--primary-active);
}

.button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.message {
  border-radius: 6px;
  display: none;
  font-size: 14px;
  line-height: 1.35;
  margin-top: 16px;
  padding: 12px 16px;
}

.message.show {
  display: block;
}

.message.error {
  background: #fff6f2;
  border: 1px solid #f0c3b3;
  color: var(--danger);
}

.message.ok {
  background: #f3fbf4;
  border: 1px solid var(--success-border);
  color: var(--success);
}

.workbench-head {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  margin: 0 0 16px;
}

.workbench-head .muted {
  margin: 8px 0 0;
}

.head-meta {
  background: var(--signature-cream);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 12px;
  white-space: nowrap;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 300px minmax(0, 1fr);
}

.panel {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 20px;
}

.submit-panel {
  align-self: start;
}

.task-panel {
  min-width: 0;
}

.panel-head {
  align-items: center;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 0 16px;
  padding-bottom: 16px;
}

.panel-head h1 {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.5;
}

.panel-head .muted {
  margin: 4px 0 0;
}

.upload-name {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap {
  border: 1px solid var(--hairline);
  border-radius: 10px;
  max-height: calc(100vh - 214px);
  overflow: auto;
}

table {
  border-collapse: collapse;
  font-size: 14px;
  min-width: 760px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--hairline);
  line-height: 1.25;
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 1;
}

.status {
  border-radius: 6px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  padding: 5px 8px;
}

.status-pending {
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  color: var(--body);
}

.status-running {
  background: #fff9e8;
  border: 1px solid #e8c76d;
  color: #76520b;
}

.status-done {
  background: #f3fbf4;
  border: 1px solid var(--success-border);
  color: var(--success);
}

.status-failed {
  background: #fff6f2;
  border: 1px solid #f0c3b3;
  color: var(--danger);
}

.report-frame {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  min-height: calc(100vh - 112px);
  overflow: hidden;
}

.report-frame iframe {
  border: 0;
  height: calc(100vh - 116px);
  width: 100%;
}

#statePanel {
  margin: 24px auto 0;
  max-width: 560px;
}

.footer {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  padding: 24px 48px 32px;
  text-align: center;
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    padding: 16px 24px;
  }

  .nav {
    flex-wrap: wrap;
    gap: 16px;
  }

  .container,
  .auth-wrap {
    padding: 24px;
  }

  .workbench-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

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

  .panel {
    padding: 20px;
  }

  .table-wrap {
    max-height: none;
  }
}
