:root {
  --ink-950: #061a1f;
  --ink-900: #0a2a32;
  --ink-800: #0f3a44;
  --ink-700: #164a56;
  --teal-800: #0a6b66;
  --teal-700: #0c857f;
  --teal-600: #12a39a;
  --teal-500: #1ebdb3;
  --teal-100: #daf5f2;
  --teal-50: #eefaf8;
  --cyan-400: #3dd4c8;
  --mist-100: #e6f0f2;
  --mist-50: #f2f7f8;
  --ink: #142830;
  --muted: #5f7580;
  --line: #d4e2e6;
  --line-soft: #e8f0f2;
  --surface: #ffffff;
  --canvas: #eef4f5;
  --success: #147a56;
  --success-bg: #e3f5ec;
  --warning: #9a6408;
  --warning-bg: #fff3d6;
  --danger: #b13a45;
  --danger-bg: #fdecee;
  --shadow-sm: 0 1px 2px rgba(6, 26, 31, 0.04), 0 4px 16px rgba(6, 26, 31, 0.03);
  --shadow-md: 0 14px 40px rgba(6, 26, 31, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-width: 248px;
  --font-display: "Syne", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Source Sans 3", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, "SFMono-Regular", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 50% at 100% -10%, rgba(30, 189, 179, 0.09), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(15, 58, 68, 0.05), transparent 50%),
    linear-gradient(180deg, #f4f8f9 0%, var(--canvas) 40%, #e9f1f3 100%);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, .brand strong, .mobile-brand {
  font-family: var(--font-display);
}

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

/* —— Sidebar —— */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 28px 18px 20px;
  overflow-y: auto;
  color: #c5dce2;
  background:
    linear-gradient(165deg, rgba(30, 189, 179, 0.14) 0%, transparent 38%),
    linear-gradient(180deg, #041416 0%, #062428 55%, #0a353c 100%);
  box-shadow: 10px 0 32px rgba(4, 20, 22, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.sidebar .brand {
  color: #fff;
  margin: 0 6px 34px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px 11px 11px 3px;
  background:
    linear-gradient(145deg, var(--teal-500), #0a7a85);
  box-shadow: 0 10px 24px rgba(14, 140, 135, 0.32);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: -0.02em;
  font-size: 21px;
  font-weight: 750;
  line-height: 1.1;
}

.brand small {
  margin-top: 4px;
  color: #7aa0a8;
  letter-spacing: 0.02em;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
}

.nav-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.nav-list > a {
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: #8fb0b8;
  border-radius: 9px;
  transition: color 160ms ease, background 160ms ease;
}

.nav-list > a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-list > a.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(18, 163, 154, 0.28), rgba(18, 163, 154, 0.06));
}

.nav-list > a.active::before {
  position: absolute;
  left: 0;
  width: 3px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: var(--cyan-400);
  content: "";
}

.nav-icon {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #6e949c;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.active .nav-icon {
  color: var(--cyan-400);
}

.nav-section {
  padding: 22px 12px 8px;
  color: #5d8088;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 650;
}

.sidebar-footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 11px;
}

.avatar {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  color: #d5fffa;
  border: 1px solid rgba(61, 212, 200, 0.28);
  border-radius: 50%;
  background: rgba(18, 163, 154, 0.22);
  font-family: var(--font-display);
  font-weight: 700;
}

.user-copy {
  min-width: 0;
}

.user-copy strong,
.user-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy strong {
  color: #f0f8fa;
  font-size: 13px;
}

.user-copy small {
  margin-top: 2px;
  color: #6e9098;
  font-size: 12px;
}

.account-links {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}

.account-links a,
.account-links button {
  padding: 0;
  color: #6e9098;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.account-links a:hover,
.account-links button:hover {
  color: #fff;
}

.main-area {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.mobile-header {
  display: none;
}

.page-container {
  width: min(1320px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 36px 40px 28px;
}

.page-footer {
  padding: 48px 0 8px;
  color: #8fa4ab;
  text-align: center;
  font-size: 12px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.page-head.compact {
  align-items: flex-start;
  margin-bottom: 24px;
}

.page-head h1 {
  margin: 6px 0 6px;
  color: var(--ink-950);
  letter-spacing: -0.03em;
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 720;
  line-height: 1.18;
}

.page-head p {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 15px;
}

.page-head-note {
  max-width: none;
  white-space: nowrap;
}

.dashboard-head {
  align-items: center;
}

.dashboard-head-copy {
  min-width: 0;
  flex: 1;
}

.dashboard-head .button-create {
  align-self: center;
  margin-top: 4px;
}

.button-create {
  flex: 0 0 auto;
  white-space: nowrap;
  gap: 8px;
}

.button-create svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button-create span {
  white-space: nowrap;
}

.eyebrow {
  display: inline-block;
  color: var(--teal-700);
  letter-spacing: 0.04em;
  font-size: 12px;
  font-weight: 650;
  text-transform: none;
}

.eyebrow-light {
  color: var(--cyan-400);
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 650;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(18, 163, 154, 0.22);
  outline-offset: 2px;
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, #0e948c, var(--teal-600));
  box-shadow: 0 8px 20px rgba(12, 133, 127, 0.22);
}

.button-primary:hover {
  background: linear-gradient(135deg, #0c827b, #0f948c);
  box-shadow: 0 10px 24px rgba(12, 133, 127, 0.3);
}

.button-secondary {
  color: var(--ink-800);
  border-color: var(--line);
  background: #fff;
}

.button-secondary:hover,
.button-ghost:hover {
  background: var(--mist-50);
}

.button-ghost {
  color: var(--muted);
  border-color: var(--line);
  background: transparent;
}

.button-large {
  min-height: 48px;
  padding-inline: 22px;
}

.button-full {
  width: 100%;
}

.button-with-icon {
  flex-shrink: 0;
  white-space: nowrap;
}

.button-with-icon > span,
.button-with-icon > svg {
  display: inline-grid;
  place-items: center;
  line-height: 1;
  flex-shrink: 0;
}

.button-with-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.content-card {
  border: 1px solid rgba(196, 214, 218, 0.75);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
}

/* Metrics — light strip, not heavy cards */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 36px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: var(--shadow-sm);
}

.metric-card {
  position: relative;
  display: flex;
  min-height: 108px;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

.metric-card::after {
  display: none;
}

.metric-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  color: var(--ink-700);
  border-radius: 10px;
  background: var(--mist-100);
}

.metric-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-running .metric-icon {
  color: var(--warning);
  background: var(--warning-bg);
}

.metric-completed .metric-icon {
  color: var(--success);
  background: var(--success-bg);
}

.metric-users .metric-icon {
  color: var(--teal-700);
  background: var(--teal-100);
}

.metric-failed .metric-icon {
  color: var(--danger);
  background: var(--danger-bg);
}

.metric-card small,
.metric-card strong,
.metric-card p {
  display: block;
}

.metric-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.metric-card strong {
  margin: 2px 0 0;
  color: var(--ink-950);
  letter-spacing: -0.04em;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 720;
  line-height: 1.15;
}

.metric-card p {
  margin: 3px 0 0;
  color: #8fa3aa;
  font-size: 12px;
}

.section-block {
  margin-top: 32px;
}

.section-heading,
.card-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h2,
.card-heading h2 {
  margin: 2px 0 0;
  color: var(--ink-950);
  font-size: 20px;
  font-weight: 700;
}

.section-heading > a,
.card-heading > a {
  color: var(--teal-700);
  font-size: 13px;
  font-weight: 650;
}

.active-job-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.active-job-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.active-job-card:hover {
  transform: translateY(-2px);
  border-color: #9fd4ce;
  box-shadow: var(--shadow-md);
}

.active-job-top,
.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.active-job-card h3 {
  margin: 16px 0 4px;
  overflow: hidden;
  color: var(--ink-950);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-line {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.job-code {
  color: #8fa3aa;
  font-family: var(--font-mono);
  font-size: 11px;
}

.progress-line,
.mini-progress,
.large-progress {
  overflow: hidden;
  border-radius: 999px;
  background: #e4eef0;
}

.progress-line {
  height: 5px;
  margin-top: 16px;
}

.progress-line span,
.mini-progress span,
.large-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal-600), var(--cyan-400));
  transition: width 450ms ease;
}

.progress-copy {
  margin-top: 8px;
  color: #859aa1;
  font-size: 12px;
}

.progress-copy strong {
  color: var(--teal-700);
}

.status-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  color: #586b74;
  border-radius: 999px;
  background: #edf3f4;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.status-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-pending,
.status-running {
  color: var(--warning);
  background: var(--warning-bg);
}

.status-running i {
  box-shadow: 0 0 0 4px rgba(154, 100, 8, 0.12);
  animation: pulse 1.8s infinite;
}

.status-completed {
  color: var(--success);
  background: var(--success-bg);
}

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

.status-cancelled {
  color: #65747c;
  background: #eef2f3;
}

@keyframes pulse {
  50% { box-shadow: 0 0 0 6px rgba(154, 100, 8, 0); }
}

.table-card {
  overflow: hidden;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 14px 18px;
  color: #6b8189;
  border-bottom: 1px solid var(--line);
  background: #f7fafb;
  letter-spacing: 0.02em;
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}

.data-table td {
  padding: 16px 18px;
  color: #455a63;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background 120ms ease;
}

.data-table tbody tr:hover {
  background: #f8fcfb;
}

.project-link strong,
.project-link small,
.subline,
.table-user small {
  display: block;
}

.project-link strong {
  max-width: 320px;
  overflow: hidden;
  color: var(--ink-900);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-link small,
.subline,
.table-user small {
  margin-top: 3px;
  color: #8fa3aa;
  font-size: 12px;
}

.table-unit {
  color: #8fa3aa;
  font-weight: 400;
}

.table-action {
  color: var(--teal-700);
  font-weight: 700;
  white-space: nowrap;
}

.muted-action {
  color: #657880;
}

.empty-state {
  padding: 56px 24px;
  text-align: center;
}

.empty-symbol {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  place-items: center;
  color: var(--teal-700);
  border-radius: 14px;
  background: var(--teal-100);
}

.empty-symbol svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

.empty-state h3 {
  margin: 0 0 6px;
  color: var(--ink-950);
  font-size: 18px;
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--muted);
}

.message-stack {
  position: fixed;
  top: 22px;
  right: 26px;
  z-index: 80;
  display: grid;
  width: min(410px, calc(100vw - 30px));
  gap: 8px;
}

.message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: #1a5a48;
  border: 1px solid #bde5d4;
  border-radius: 10px;
  background: #eefaf5;
  box-shadow: var(--shadow-md);
}

.message-error {
  color: #9d303c;
  border-color: #f1c7cc;
  background: #fff1f2;
}

.message-warning {
  color: #8c5a09;
  border-color: #efdcae;
  background: #fff8e6;
}

.message button {
  color: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
}

/* Forms */
.analysis-form {
  display: grid;
  gap: 18px;
}

.form-section {
  position: relative;
  padding: 28px 30px 30px;
}

.form-section-number {
  position: absolute;
  top: 24px;
  right: 26px;
  color: #dfe9eb;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
}

.form-section-head {
  margin-bottom: 22px;
}

.form-section-head h2 {
  margin: 4px 0 4px;
  color: var(--ink-950);
  font-size: 22px;
}

.form-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-span-2 {
  grid-column: span 2;
}

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

.field-group > label {
  display: block;
  margin-bottom: 7px;
  color: #2f4650;
  font-size: 13px;
  font-weight: 700;
}

.field-group label b {
  color: var(--danger);
}

.field-group input:not([type="checkbox"]):not([type="file"]),
.field-group textarea,
.field-group select,
.filter-form input,
.filter-form select {
  width: 100%;
  color: var(--ink);
  border: 1px solid #c5d5da;
  border-radius: var(--radius-sm);
  outline: none;
  background: #fff;
  transition: border 120ms ease, box-shadow 120ms ease;
}

.field-group input:not([type="checkbox"]):not([type="file"]),
.field-group select {
  height: 44px;
  padding: 0 12px;
}

.field-group textarea {
  min-height: 94px;
  padding: 11px 12px;
  resize: vertical;
}

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus,
.filter-form input:focus,
.filter-form select:focus {
  border-color: #4fb5ae;
  box-shadow: 0 0 0 3px rgba(18, 163, 154, 0.12);
}

.field-help {
  display: block;
  margin-top: 6px;
  color: #81959c;
  font-size: 12px;
}

.field-help ul {
  margin: 6px 0 0 18px;
  padding: 0;
}

.field-error {
  display: block;
  margin-top: 6px;
  color: var(--danger);
  font-size: 12px;
}

.block-error {
  margin: 8px 4px 0;
}

.form-alert {
  padding: 11px 13px;
  color: #9d303c;
  border: 1px solid #f1c7cc;
  border-radius: var(--radius-sm);
  background: #fff1f2;
  font-size: 13px;
}

.chain-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.chain-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafcfc;
}

.chain-panel-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
}

.chain-panel-head h3,
.chain-panel-head p {
  margin: 0;
}

.chain-panel-head h3 {
  color: var(--ink-950);
  font-size: 16px;
}

.chain-panel-head p {
  color: #8499a0;
  font-size: 12px;
}

.chain-tag {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 800;
}

.chain-f {
  color: #146878;
  background: #dff1f4;
}

.chain-r {
  color: #8a5a12;
  background: #f8eedc;
}

.upload-zone {
  position: relative;
  display: flex;
  min-height: 148px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 18px;
  color: #4f6670;
  border: 1.5px dashed #a8c0c7;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: 140ms ease;
}

.upload-zone:hover,
.upload-zone.has-file {
  border-color: var(--teal-600);
  background: var(--teal-50);
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-icon {
  display: grid;
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
  place-items: center;
  color: var(--teal-700);
  border-radius: 10px;
  background: var(--teal-100);
}

.upload-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

.upload-zone strong {
  color: #2f4650;
  font-size: 13px;
}

.upload-zone small {
  margin-top: 4px;
  color: #8499a0;
  font-size: 12px;
}

.selected-file {
  max-width: 100%;
  margin-top: 10px;
  padding: 4px 10px;
  overflow: hidden;
  color: #657880;
  border-radius: 6px;
  background: #eef3f4;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.has-file .selected-file {
  color: var(--teal-700);
  background: var(--teal-100);
}

.input-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: #8fa3aa;
  font-size: 12px;
  text-transform: none;
}

.input-divider::before,
.input-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.sequence-input {
  min-height: 135px !important;
  color: #2a4550 !important;
  font-family: var(--font-mono) !important;
  font-size: 12px !important;
  line-height: 1.65 !important;
}

.submission-note,
.permission-banner,
.result-alert {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 16px 18px;
  border: 1px solid #b5e0d8;
  border-radius: var(--radius);
  background: #eef9f6;
}

.note-icon,
.permission-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  color: #fff;
  border-radius: 8px;
  background: var(--teal-600);
  font-size: 12px;
  font-weight: 800;
}

.submission-note strong,
.submission-note p,
.permission-banner strong,
.permission-banner p {
  margin: 0;
}

.submission-note strong,
.permission-banner strong {
  color: #175e58;
  font-size: 14px;
}

.submission-note p,
.permission-banner p {
  margin-top: 3px;
  color: #4f7874;
  font-size: 13px;
}

.form-submit-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 6px 0 8px;
}

.form-card {
  padding: 28px;
}

.narrow-card {
  max-width: 650px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

.checkbox-field label {
  display: flex;
  align-items: center;
  gap: 9px;
}

.checkbox-field input {
  width: 17px;
  height: 17px;
  accent-color: var(--teal-600);
}

/* History */
.filter-card {
  margin-bottom: 15px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
}

.filter-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  position: relative;
  min-width: 280px;
  flex: 1;
}

.search-box > span,
.search-box > .search-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  display: grid;
  place-items: center;
  color: #8499a0;
  transform: translateY(-50%);
}

.search-box .search-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

.filter-form input,
.filter-form select {
  height: 40px;
  padding: 0 12px;
}

.filter-form input {
  padding-left: 38px;
}

.filter-form select {
  width: 150px;
}

.clear-filter {
  padding: 8px;
  color: var(--muted);
  font-size: 13px;
}

.history-table td {
  padding-block: 17px;
}

.mini-progress {
  width: 88px;
  height: 3px;
  margin-top: 6px;
}

.table-user {
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar-table {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  color: var(--teal-700);
  border-color: #c4e4e1;
  background: #e9f7f5;
  font-size: 12px;
}

.table-user strong {
  color: #344d57;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 14px 18px;
  color: #6f848c;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.pagination a {
  color: var(--teal-700);
  font-weight: 700;
}

/* Detail */
.breadcrumb {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  color: #8499a0;
  font-size: 13px;
}

.breadcrumb a {
  color: var(--teal-700);
}

.detail-head {
  align-items: flex-start;
}

.title-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.title-status-row h1 {
  margin-top: 0;
}

.head-actions {
  display: flex;
  gap: 9px;
}

.head-actions form {
  display: inline-flex;
}

.progress-card {
  margin-bottom: 18px;
  padding: 24px 26px;
  background: linear-gradient(145deg, #fff, #f6fbfb);
}

.progress-card-top,
.progress-card-top > div {
  display: flex;
  align-items: center;
}

.progress-card-top {
  justify-content: space-between;
  gap: 20px;
}

.progress-card-top > div {
  gap: 13px;
}

.pulse-mark {
  width: 14px;
  height: 14px;
  border: 3px solid #b7e5e0;
  border-radius: 50%;
  background: var(--teal-600);
  box-shadow: 0 0 0 5px #e3f7f4;
  animation: pulse-teal 2s infinite;
}

@keyframes pulse-teal {
  50% { box-shadow: 0 0 0 9px rgba(227, 247, 244, 0); }
}

.progress-card-top small {
  color: #7a9098;
  font-size: 12px;
}

.progress-card-top h2 {
  margin: 2px 0 0;
  color: var(--ink-950);
  font-size: 18px;
}

.progress-card-top > strong {
  color: var(--teal-700);
  font-family: var(--font-display);
  font-size: 24px;
}

.large-progress {
  height: 8px;
  margin: 18px 0 16px;
}

.pipeline-steps {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #8fa3aa;
  font-size: 12px;
}

.pipeline-steps span::before {
  margin-right: 5px;
  content: "○";
}

.pipeline-steps span.done {
  color: var(--teal-700);
  font-weight: 700;
}

.pipeline-steps span.done::before {
  content: "●";
}

.progress-hint {
  margin: 18px 0 0;
  padding-top: 14px;
  color: #7a9098;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
}

.result-alert {
  margin-bottom: 18px;
  border-color: #d0dde1;
  background: #f7fafb;
}

.result-alert > span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: #6f848c;
  font-weight: 800;
}

.result-alert strong,
.result-alert p {
  margin: 0;
}

.result-alert strong {
  color: var(--ink-900);
}

.result-alert p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.result-alert-success {
  border-color: #b8e2d0;
  background: #eefaf5;
}

.result-alert-success > span {
  background: var(--success);
}

.result-alert-error {
  border-color: #f0cbd0;
  background: #fff3f4;
}

.result-alert-error > span {
  background: var(--danger);
}

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

.detail-main,
.detail-side {
  display: grid;
  align-content: start;
  gap: 18px;
}

.result-preview,
.artifact-card,
.info-card,
.log-card {
  padding: 22px;
}

.card-heading {
  margin-bottom: 16px;
}

.card-heading > span {
  color: #8499a0;
  font-size: 13px;
}

.image-frame {
  display: grid;
  max-height: 620px;
  min-height: 280px;
  place-items: center;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(45deg, #f4f8f9 25%, transparent 25%),
    linear-gradient(-45deg, #f4f8f9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f4f8f9 75%),
    linear-gradient(-45deg, transparent 75%, #f4f8f9 75%);
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-size: 12px 12px;
}

.image-frame img {
  display: block;
  max-width: 100%;
  height: auto;
}

.artifact-group + .artifact-group {
  margin-top: 20px;
}

.artifact-group h3 {
  margin: 0 0 8px;
  color: #6b8189;
  letter-spacing: 0.02em;
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}

.artifact-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.artifact-row {
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 11px;
  min-height: 56px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 120ms ease;
}

.artifact-row:last-child {
  border-bottom: 0;
}

.artifact-row:hover {
  background: #f6fbfa;
}

.file-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #1f5f70;
  border-radius: 8px;
  background: #dff1f4;
  font-size: 9px;
  font-weight: 800;
}

.file-report {
  color: #1f6a4a;
  background: #e0f3e9;
}

.file-image {
  color: #8a5a12;
  background: #f8eedc;
}

.file-fasta {
  color: #1f5f70;
  background: #dff1f4;
}

.artifact-name {
  min-width: 0;
}

.artifact-name strong,
.artifact-name small {
  display: block;
}

.artifact-name strong {
  overflow: hidden;
  color: #2f4650;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-name small {
  margin-top: 2px;
  color: #8fa3aa;
  font-size: 12px;
}

.artifact-size {
  color: #7a9098;
  font-size: 12px;
}

.download-mark {
  color: var(--teal-700);
  font-size: 16px;
}

.info-card .card-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.info-list {
  margin: 0;
}

.info-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.info-list dt {
  color: #7a9098;
  font-size: 13px;
}

.info-list dd {
  margin: 0;
  color: #2f4650;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.project-note {
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #f4f8f9;
}

.project-note small {
  color: #8499a0;
  font-size: 12px;
}

.project-note p {
  margin: 4px 0 0;
  color: #4f6670;
  font-size: 13px;
}

.safety-card {
  display: flex;
  gap: 11px;
  padding: 17px;
  border-color: #c5e4df;
  background: #f2faf8;
}

.safety-icon {
  color: var(--teal-700);
  font-size: 18px;
}

.safety-card strong,
.safety-card p {
  margin: 0;
}

.safety-card strong {
  color: #1f5e58;
  font-size: 13px;
}

.safety-card p {
  margin-top: 3px;
  color: #5a7d78;
  font-size: 12px;
}

.danger-actions {
  display: grid;
  gap: 6px;
  padding: 5px 3px;
}

.danger-actions button {
  padding: 5px 0;
  color: #6f848c;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
}

.danger-actions .danger-link {
  color: var(--danger);
}

.log-card summary {
  color: #3f5862;
  cursor: pointer;
  font-weight: 700;
}

.log-card pre {
  max-height: 430px;
  margin: 15px 0 0;
  padding: 14px;
  overflow: auto;
  color: #d5e8ec;
  border-radius: var(--radius-sm);
  background: #061a1f;
  font: 12px/1.7 var(--font-mono);
  white-space: pre-wrap;
}

/* Users */
.permission-banner {
  margin-bottom: 17px;
}

.user-table td {
  padding-block: 16px;
}

.avatar-admin {
  color: #fff;
  border-color: #0a827d;
  background: var(--teal-700);
}

.role-pill {
  display: inline-flex;
  padding: 4px 9px;
  color: #4f6670;
  border-radius: 999px;
  background: #edf3f4;
  font-size: 12px;
  font-weight: 650;
}

.role-admin {
  color: #0f6e68;
  background: var(--teal-100);
}

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

.row-actions a,
.row-actions button {
  padding: 0;
  color: var(--teal-700);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.row-actions button {
  color: var(--danger);
}

.muted {
  color: #8fa3aa !important;
}

/* —— Login (white topbar + blue card, screenshot style) —— */
.auth-page {
  background: #eef3f7;
}

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 70% 55% at 15% 20%, rgba(37, 99, 168, 0.06), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 80%, rgba(37, 99, 168, 0.04), transparent 50%),
    linear-gradient(180deg, #f5f8fb 0%, #e8eef4 100%);
}

.login-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 64px;
  padding: 0 36px;
  background: #fff;
  border-bottom: 1px solid rgba(196, 210, 220, 0.7);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.login-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #163a5c;
}

.brand-mark-sm {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 9px 9px 9px 3px;
  background: linear-gradient(145deg, #1f5f9a, #164a7a);
  box-shadow: 0 6px 14px rgba(22, 74, 122, 0.25);
  font-size: 16px;
}

.login-topbar-brand strong,
.login-topbar-brand small {
  display: block;
}

.login-topbar-brand strong {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.login-topbar-brand small {
  margin-top: 2px;
  color: #6b8498;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
}

.login-topbar-meta {
  color: #7a92a5;
  font-size: 13px;
}

.login-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 440px);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  width: min(1120px, calc(100% - 64px));
  margin: 0 auto;
  padding: 48px 0 56px;
}

.login-intro {
  max-width: 540px;
}

.login-kicker {
  display: inline-block;
  color: #1f5f9a;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 750;
}

.login-intro h1 {
  margin: 14px 0 16px;
  color: #143a5c;
  letter-spacing: -0.035em;
  font-family: var(--font-display);
  font-size: clamp(32px, 4.2vw, 46px);
  font-weight: 750;
  line-height: 1.2;
}

.login-intro > p {
  margin: 0 0 28px;
  max-width: 42ch;
  color: #5f7588;
  font-size: 15px;
  line-height: 1.75;
}

.login-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.login-steps li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  color: #24384a;
  border: 1px solid #d5e1ea;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 8px rgba(20, 58, 92, 0.04);
  font-size: 13px;
  font-weight: 600;
}

.login-steps .step-num {
  color: #d64545;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.login-card {
  padding: 36px 34px 28px;
  border: 1px solid rgba(205, 218, 228, 0.85);
  border-radius: 28px;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(20, 58, 92, 0.04),
    0 18px 48px rgba(20, 58, 92, 0.1);
  animation: card-rise 520ms ease both;
}

.login-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.login-card-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(145deg, #1f5f9a, #164a7a);
  box-shadow: 0 8px 18px rgba(22, 74, 122, 0.28);
}

.login-card-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-card-head h2 {
  margin: 0;
  color: #143a5c;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.login-card-head p {
  margin: 4px 0 0;
  color: #7a92a5;
  font-size: 14px;
}

.login-form {
  gap: 18px;
}

.login-card .field-group > label {
  color: #163a5c;
  font-size: 13px;
  font-weight: 700;
}

.login-card .field-group input:not([type="checkbox"]):not([type="file"]) {
  height: 48px;
  border-color: #b8cddd;
  border-radius: 10px;
  background: #fff;
}

.login-card .field-group input:focus {
  border-color: #1f5f9a;
  box-shadow: 0 0 0 3px rgba(31, 95, 154, 0.14);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 58px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  padding: 0;
  color: #1f5f9a;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: #143a5c;
}

.login-submit {
  margin-top: 6px;
  min-height: 50px;
  border-radius: 11px;
  background: linear-gradient(135deg, #1f5f9a, #164a7a);
  box-shadow: 0 10px 22px rgba(22, 74, 122, 0.24);
}

.login-submit:hover {
  background: linear-gradient(135deg, #1a5488, #123f68);
  box-shadow: 0 12px 26px rgba(22, 74, 122, 0.3);
}

.login-footnote {
  margin: 22px 0 0;
  color: #8aa0b0;
  text-align: center;
  font-size: 12px;
  line-height: 1.55;
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .metric-grid,
  .active-job-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 250px;
  }

  .sidebar {
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 18px 0 55px rgba(4, 20, 22, 0.35);
  }

  .main-area {
    margin-left: 0;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    height: 60px;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(247, 251, 251, 0.94);
    backdrop-filter: blur(12px);
  }

  .menu-button {
    width: 38px;
    height: 38px;
    color: var(--ink-800);
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 20px;
  }

  .mobile-brand {
    color: var(--ink-900);
    font-size: 18px;
    font-weight: 750;
  }

  .avatar-small {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    color: var(--teal-700);
    border-color: #c4e4e1;
    background: #e9f7f5;
  }

  .page-container {
    padding: 26px 20px 20px;
  }

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

  .detail-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .danger-actions {
    grid-column: span 2;
  }

  .login-main {
    grid-template-columns: 1fr;
    width: min(520px, calc(100% - 40px));
    gap: 28px;
    padding: 32px 0 40px;
  }

  .login-intro {
    max-width: none;
    text-align: center;
  }

  .login-intro > p {
    margin-inline: auto;
  }

  .login-steps {
    justify-content: center;
  }
}

@media (max-width: 680px) {
  .page-container {
    padding-inline: 15px;
  }

  .page-head,
  .detail-head {
    align-items: stretch;
    flex-direction: column;
  }

  .page-head .button,
  .head-actions .button {
    width: 100%;
  }

  .head-actions {
    width: 100%;
    flex-direction: column;
  }

  .head-actions form {
    display: block;
  }

  .metric-grid,
  .active-job-grid,
  .chain-grid,
  .two-columns,
  .detail-side {
    grid-template-columns: 1fr;
  }

  .field-span-2,
  .danger-actions {
    grid-column: auto;
  }

  .metric-card {
    min-height: 96px;
  }

  .form-section {
    padding: 22px 16px;
  }

  .form-section-number {
    display: none;
  }

  .filter-form {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box,
  .filter-form select {
    width: 100%;
    min-width: 0;
  }

  .pipeline-steps {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .title-status-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .artifact-row {
    grid-template-columns: 38px minmax(0, 1fr) 20px;
  }

  .artifact-size {
    display: none;
  }

  .form-submit-bar,
  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .form-submit-bar .button,
  .form-actions .button {
    width: 100%;
  }

  .login-topbar {
    height: auto;
    min-height: 58px;
    padding: 12px 16px;
    flex-wrap: wrap;
  }

  .login-topbar-meta {
    display: none;
  }

  .login-main {
    width: calc(100% - 28px);
    padding: 24px 0 32px;
  }

  .login-intro h1 {
    font-size: 28px;
  }

  .login-card {
    padding: 28px 20px 22px;
    border-radius: 22px;
  }

  .login-card-head h2 {
    font-size: 22px;
  }

  .message-stack {
    top: 12px;
    right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
