/* BioFlow UI. Colours and type follow the DCA frontend theme (src/theme/theme.less in DCA-Frontend). */
:root {
  --bg: #f6faf1;
  --ink: #1e1e2d;
  --text: rgba(0, 0, 0, 0.85);
  --muted: #606060;
  --subtle: #707070;
  --card: #ffffff;
  --border: #e2e2e2;
  --field: #d9d9d9;
  --primary: #007680;
  --link: #0076a8;
  --link-hover: #005a7d;
  --green: #86bc25;
  --navy-1: #001529;
  --navy-2: #002140;
  --table-head: #e6efdc;
  --shadow: 0 1px 2px #15223214;
  --mono: source-code-pro, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Poppins', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
a:hover { color: var(--link-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
h1, h2, p, dl, dd, ol { margin: 0; padding: 0; }

/* ---- App shell -------------------------------------------------------------------------------------- */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar {
  flex: 1 1 240px;
  background: linear-gradient(180deg, var(--navy-1) 0%, var(--navy-2) 100%);
  color: rgba(255, 255, 255, 0.85);
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 12px; }
.brand-icon {
  position: relative;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1e1e2c;
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.brand-icon img { position: absolute; left: 8px; top: 6px; width: 20px; height: 23px; }
.brand-name { font-size: 18px; font-weight: 600; color: #fff; }
.brand-tag {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  padding: 1px 6px;
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}
.nav a:hover { color: var(--green); }
.nav a[aria-current='page'] { color: var(--green); background: rgba(134, 188, 37, 0.12); }
.sidebar-note {
  margin-top: auto;
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
}
.sidebar-note strong { display: block; color: #fff; font-weight: 500; margin-bottom: 4px; }

.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff;
  border-bottom: 2px solid var(--green);
  padding: 14px 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.crumbs { color: #6b6b6b; }
.crumbs a { text-decoration: none; }
.crumbs strong { color: var(--text); font-weight: 500; }
.topbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 12px; }
.pill { border-radius: 4px; padding: 3px 10px; font-weight: 500; }
.pill-info { background: #e0ebf6; color: #1f5fa3; }
.pill-env { background: #f6f6f6; color: #4a4a4a; }
.who { color: var(--muted); }
.linklike {
  background: none;
  border: 0;
  padding: 6px 4px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--link);
  cursor: pointer;
}
.linklike:hover { color: var(--link-hover); text-decoration: underline; }

.content { padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { font-size: 26px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.page-head p { max-width: 640px; line-height: 1.6; color: var(--muted); }

/* ---- Buttons ----------------------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 6px;
  border: 1px solid var(--field);
  background: #fff;
  color: #363643;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { color: #363643; border-color: #bdbdbd; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { color: #fff; border-color: var(--primary); filter: brightness(0.93); }
.btn-danger { border-color: #bf6356; color: #9c3318; }
.btn-danger:hover { color: #9c3318; border-color: #9c3318; }

/* ---- Cards, KPIs, table -------------------------------------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.card-pad { padding: 24px; }
.card h2 { font-size: 16px; font-weight: 600; color: var(--ink); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpi { padding: 18px 20px; }
.kpi-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.kpi-value { margin-top: 8px; font-size: 30px; font-weight: 600; color: var(--ink); line-height: 1.1; }
.kpi-note { margin-top: 4px; font-size: 12px; color: var(--subtle); }

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  border: 1px solid var(--field);
  background: #fff;
  color: #363643;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.chip[aria-pressed='true'] { background: var(--primary); border-color: var(--primary); color: #fff; }

.table-scroll { overflow-x: auto; }
.table { min-width: 860px; }
.row {
  display: grid;
  grid-template-columns: 2.2fr 1.1fr 2fr 0.6fr 1.1fr 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f2f2f2;
}
.row-head {
  padding: 12px 20px;
  background: var(--table-head);
  border-bottom: 0;
  font-size: 12px;
  font-weight: 600;
  color: #4d5148;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.job-name { font-weight: 500; text-decoration: none; }
.job-image { font-size: 12px; color: var(--subtle); margin-top: 2px; }
.cell-muted { color: #4a4a4a; }
.badge { display: inline-block; border-radius: 12px; padding: 3px 12px; font-size: 12px; font-weight: 500; }
.st-running { background: #ffe477; color: #814c02; }
.st-queued { background: #e4e9f0; color: #3d4a5c; }
.st-completed { background: #bee8f8; color: #005a7d; }
.st-failed { background: #f8d9d1; color: #9c3318; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---- Forms ------------------------------------------------------------------------------------------- */
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.form { flex: 3 1 440px; min-width: 0; padding: 28px; display: flex; flex-direction: column; gap: 22px; }
.aside { flex: 2 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 200px; }
.field-wide { flex-basis: 260px; }
.field label, .field .label { font-size: 13px; font-weight: 500; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--subtle); }
.field-row { display: flex; flex-wrap: wrap; gap: 22px; }
input[type='text'], select, textarea {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--field);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  color: var(--text);
}
textarea { padding: 10px 12px; resize: vertical; line-height: 1.5; }
.mono { font-family: var(--mono); font-size: 13px; }
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1;
  min-height: 44px;
  border-radius: 6px;
  border: 1px solid var(--field);
  background: #fff;
  color: #363643;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.seg button[aria-pressed='true'] { background: var(--primary); border-color: var(--primary); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 22px; border-top: 1px solid #f2f2f2; }

.cost { padding: 20px; }
.cost-label { font-size: 13px; color: var(--muted); }
.cost-value { margin-top: 6px; font-size: 28px; font-weight: 600; color: var(--ink); }
.cost-note { margin-top: 4px; font-size: 12px; line-height: 1.6; color: var(--subtle); }
.dark { background: #1e1e2d; border-radius: 8px; padding: 20px 24px; color: #e4e9f0; }
.dark-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dark-title { font-size: 13px; font-weight: 500; color: #fff; }
.dark-tag { font-size: 11px; color: #d9ef79; border: 1px solid #d9ef79; border-radius: 4px; padding: 1px 8px; }
.dark pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12.5px; line-height: 1.7; }

/* ---- Job detail ------------------------------------------------------------------------------------------ */
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.sub { margin-top: 8px; color: var(--muted); }
.head-actions { display: flex; gap: 12px; }
.usage-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.bar { margin-top: 10px; height: 10px; border-radius: 5px; background: #e7f0bb; overflow: hidden; }
.bar > div { height: 100%; background: var(--green); }
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.steps { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.step { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid #f2f2f2; }
.step-icon { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.step-done .step-icon { background: #eafdf9; color: #0b7a62; }
.step-active .step-icon { background: #ffe477; color: #814c02; }
.step-waiting .step-icon { background: #f2f2f2; color: #6b6b6b; }
.step-body { flex: 1; min-width: 0; }
.step-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.step-title { font-weight: 500; color: var(--ink); }
.step-state { font-size: 12px; font-weight: 500; }
.step-done .step-state { color: #0b7a62; }
.step-active .step-state { color: #814c02; }
.step-waiting .step-state { color: #6b6b6b; }
.step-detail { margin-top: 2px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.details { display: grid; grid-template-columns: minmax(110px, 0.8fr) 2fr; gap: 12px 16px; font-size: 13px; }
.details dt { color: var(--subtle); }
.details dd { overflow-wrap: anywhere; }
.note { font-size: 13px; color: var(--subtle); margin: 4px 0 20px; }

/* ---- Sign in ------------------------------------------------------------------------------------------------ */
.login { display: flex; flex-wrap: wrap; min-height: 100vh; }
.login-hero {
  flex: 1 1 420px;
  background: linear-gradient(180deg, var(--navy-1) 0%, var(--navy-2) 100%);
  color: rgba(255, 255, 255, 0.85);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
}
.login-hero h1 { font-size: 34px; line-height: 1.25; font-weight: 600; color: #fff; margin-bottom: 16px; }
.login-hero p { font-size: 15px; line-height: 1.7; color: rgba(255, 255, 255, 0.78); max-width: 460px; }
.rule { margin-top: 28px; width: 72px; height: 3px; background: var(--green); border-radius: 2px; }
.login-foot { font-size: 12px; color: rgba(255, 255, 255, 0.65); }
.login-side { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; }
.login-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 400px; padding: 36px 32px; }
.login-card h2 { font-size: 22px; margin-bottom: 6px; }
.login-card .lead { margin-bottom: 24px; line-height: 1.6; color: var(--muted); }
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f8d9d1;
  color: #9c3318;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 500;
}
.alert svg { flex: 0 0 18px; margin-top: 1px; }
.alert[hidden] { display: none; }
.sso-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  overflow: hidden;
}
.sso-btn:hover { color: #fff; filter: brightness(0.93); }
.sso-label { display: flex; align-items: center; gap: 10px; }
.sso-btn.loading { pointer-events: none; }
.sso-btn.loading .sso-label { opacity: 0; }
.spinner {
  display: none;
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.sso-btn.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-card .fine { margin-top: 18px; font-size: 12px; line-height: 1.6; color: var(--subtle); }
.login-footer {
  padding: 18px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--subtle);
}
