:root {
  --ink: #172033;
  --muted: #5c6573;
  --faint: #7d8694;
  --paper: #f3f4f6;
  --panel: #ffffff;
  --line: #e2e5ea;
  --navy: #123052;
  --navy-2: #1a4068;
  --navy-3: #24517d;
  --gold: #8a6a2a;
  --burgundy: #8a2436;
  --ok: #1b6b45;
  --bad: #b4233a;
  --warn: #9a5b12;
  --hover: #eef3f8;
  --shadow: 0 1px 2px rgba(18, 48, 82, 0.06);
  --serif: "Source Serif 4", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --sans: "Public Sans", "Segoe UI", Tahoma, sans-serif;
  --mono: "IBM Plex Mono", "Consolas", monospace;
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { height: 100%; cursor: default; overflow-x: hidden; max-width: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
}

.hidden { display: none !important; }

.login {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(280px, 42%) 1fr;
}
.login-brand {
  background: var(--navy);
  color: #f4efe6;
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-kicker {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #c4b48a;
  margin: 0 0 18px;
}
.login-brand h1 {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  line-height: 1.05;
}
.login-brand p {
  margin: 0;
  max-width: 28ch;
  color: #c9d3e3;
  font-size: 15px;
}
.login-foot {
  font-size: 12px;
  color: #8fa0b8;
}
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--paper);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px 28px;
}
.login-card form { width: 100%; }
.login-card .field { width: 100%; margin-bottom: 14px; }
.login-card label { margin-bottom: 8px; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  height: 44px;
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.auth-tab {
  height: 44px;
  width: 100%;
  background: #fff;
  color: var(--muted);
  border: 0;
  border-radius: 0;
  padding: 0;
  font-weight: 600;
  font-size: 13px;
}
.auth-tab:hover:not(:disabled) {
  background: var(--hover);
  border: 0;
  color: var(--navy);
}
.auth-tab.active {
  background: var(--navy);
  color: #fff;
}
.auth-tab.active:hover:not(:disabled) {
  background: var(--navy-2);
  color: #fff;
}

.channel-tab {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 600;
}
.channel-tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.channel-tab.active:hover:not(:disabled) {
  background: var(--navy-2);
}
.login-card h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 6px;
}
.login-card .lede {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 13px;
  min-height: 36px;
}
.login-card input[type="text"],
.login-card input[type="email"],
.login-card input[type="password"] {
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.25;
  border-radius: var(--radius);
}
.login-card input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(18, 48, 82, 0.14);
}
.login-card .input-wrap input {
  padding-right: 44px;
}
.input-wrap {
  position: relative;
  width: 100%;
  height: 44px;
  border-radius: var(--radius);
}
.pw-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0;
  color: var(--muted);
  box-shadow: none;
  z-index: 2;
}
.pw-toggle:hover:not(:disabled),
.pw-toggle:active:not(:disabled) {
  background: transparent !important;
  border: 0 !important;
  color: var(--navy);
}
.pw-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
  pointer-events: none;
}
.pw-toggle .icon-eye-off { display: none; }
.pw-toggle.is-on .icon-eye { display: none; }
.pw-toggle.is-on .icon-eye-off { display: block; }
.field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--faint);
}
.field-error {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--bad);
  min-height: 0;
}
.login-card #loginBtn {
  display: block;
  width: 100%;
  height: 44px;
  margin: 4px 0 0;
  padding: 0;
}
.login-card h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 6px;
}
.login-card .lede {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 13px;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
  cursor: default;
}
.field { margin-bottom: 16px; }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="month"],
input[type="number"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #c9c3b8;
  border-radius: var(--radius);
  padding: 10px 12px;
  outline: none;
  cursor: default;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"] { cursor: text; }
input:focus, select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(18, 48, 82, 0.14);
}
.login-error {
  min-height: 20px;
  color: var(--bad);
  font-size: 13px;
  margin: 0 0 12px;
}
.health-line {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--faint);
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  background: #a8a29e;
  vertical-align: middle;
}
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }

.shell {
  min-height: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
}
.shell.nav-collapsed {
  grid-template-columns: 0 1fr;
}
.shell.nav-collapsed .side {
  overflow: hidden;
  padding: 0;
  border: 0;
}
.side {
  background: var(--navy);
  color: #d7deea;
  display: flex;
  flex-direction: column;
  padding: 22px 0 16px;
  min-width: 0;
  overflow: hidden;
}
.side-brand {
  padding: 0 22px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.side-brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  color: #fff;
  font-weight: 600;
}
.side-brand span {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #c4b48a;
}
nav { padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-btn {
  appearance: none;
  background: transparent;
  border: 0;
  color: #c5d0e0;
  text-align: left;
  padding: 9px 12px;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  border-radius: 0;
  border-left: 3px solid transparent;
}
.nav-btn:hover { background: var(--navy-2); color: #fff; }
.nav-btn.active {
  background: var(--navy-3);
  color: #fff;
  border-left-color: #c4b48a;
}
.side-meta {
  margin-top: auto;
  padding: 16px 22px 4px;
  font-size: 11px;
  color: #8fa0b8;
  line-height: 1.5;
  cursor: default;
}

.shell { height: 100%; }
.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.table-wrap td.actions {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}
.table-wrap td.actions button { margin: 0 0 0 6px; }
table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f6f7f9;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  cursor: default;
}
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; cursor: default; }
tr:last-child td { border-bottom: 0; }

.crumb {
  margin: 12px 0 4px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 20px;
  margin: 16px 0 8px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.facts > div { min-width: 0; }
.facts dt {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 4px;
  font-weight: 600;
}
.facts dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#detailBack, #chargeBack { margin-bottom: 4px; }
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.topbar-left { display: flex; align-items: flex-start; gap: 12px; }
.side-toggle {
  width: 32px;
  height: 32px;
  padding: 0;
  margin-top: 2px;
  flex: 0 0 32px;
  font-size: 18px;
  line-height: 1;
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.side-toggle:hover:not(:disabled) {
  background: var(--hover);
  border-color: var(--navy);
}
.topbar h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.who { position: relative; display: flex; align-items: center; }
.avatar {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #f4efe6;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.avatar:hover:not(:disabled) {
  background: var(--navy-2);
  border-color: var(--navy-2);
  color: #fff;
}
.who-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 12px;
  z-index: 20;
  display: grid;
  gap: 10px;
}
.who-name {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
  word-break: break-word;
  white-space: pre-line;
}
.who-pop-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.who-pop button { width: 100%; }
.avatar-sm { width: 32px; height: 32px; font-size: 11px; cursor: default; }
.avatar-xl {
  width: 56px;
  height: 56px;
  font-size: 18px;
  cursor: default;
}
.profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  padding: 12px 14px;
  background: #f8f9fb;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.profile-hero-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}
.profile-form { margin-bottom: 8px; }
.content {
  padding: 24px 28px 48px;
  display: grid;
  gap: 18px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
.content > section {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px;
  min-width: 0;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 12px;
  cursor: default;
  min-width: 0;
}
.stat h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: normal;
}
.stat .n {
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px 22px;
  box-shadow: var(--shadow);
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}
.card h2 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.card-head .muted { margin: 0; }
.card-head h2 { margin: 0 0 4px; }
.card-head > button { flex: 0 0 auto; white-space: nowrap; }
.muted { color: var(--muted); font-size: 13px; }
.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 28px 12px;
  text-align: center;
  background: #f8f9fb;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.toast {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: #f0faf4;
  border: 1px solid #a7d4bc;
  color: var(--ok);
  font-size: 13px;
  font-weight: 600;
}
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; height: 38px; }
.job .toolbar { margin: 10px 0 0; }
.job .toolbar input[type="number"] { min-width: 88px; width: 88px; }

#page-webhook .card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#page-webhook .card-head { margin-bottom: 0; }
#page-webhook .card > h2 { margin: 0; }
#page-webhook .card > h2 + .muted { margin-top: -8px; }
#page-webhook .muted { margin: 0; }
#page-webhook .lab-steps { margin: 0; }
#page-webhook .form-grid { margin: 0; }
#page-webhook .toolbar { margin: 0; }
#page-webhook .log { margin: 0; }

button, .btn {
  appearance: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border-radius: var(--radius);
  padding: 0 14px;
  height: 38px;
  line-height: 36px;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button:hover:not(:disabled), .btn:hover:not(:disabled) {
  background: var(--navy-2);
  border-color: var(--navy-2);
}
button:active:not(:disabled) { background: #0c2744; }
button.ghost, .btn.ghost {
  background: #fff;
  color: var(--navy);
  border-color: #c5ced8;
}
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  height: 38px;
  box-sizing: border-box;
}
button.btn-sm, .btn.btn-sm {
  height: 30px;
  line-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  line-height: 1;
  font-size: 22px;
  font-weight: 400;
  background: transparent;
  color: var(--muted);
  border: 0;
}
.icon-btn:hover:not(:disabled) {
  background: var(--hover);
  color: var(--navy);
  border: 0;
}
button.ghost:hover:not(:disabled), .btn.ghost:hover:not(:disabled) {
  background: var(--hover);
  border-color: var(--navy);
  color: var(--navy);
}
button.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
button.ok:hover:not(:disabled) { background: #155a3a; border-color: #155a3a; }
button.danger { background: var(--burgundy); border-color: var(--burgundy); color: #fff; }
button.danger:hover:not(:disabled) { background: #731c2c; border-color: #731c2c; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

button.stat,
button.stat-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  height: auto;
  min-height: 0;
  line-height: 1.25;
  white-space: normal;
  text-align: left;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
button.stat:hover:not(:disabled),
button.stat-link:hover:not(:disabled) {
  background: var(--hover);
  border-color: var(--navy);
  color: var(--ink);
}
button.stat:active:not(:disabled),
button.stat-link:active:not(:disabled) {
  background: var(--hover);
  color: var(--ink);
}

.table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f6f7f9;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  cursor: default;
  white-space: nowrap;
}
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  cursor: default;
  overflow: hidden;
  text-overflow: ellipsis;
}
tr:last-child td { border-bottom: 0; }
tr.rowclick td { cursor: pointer; }
tr.rowclick:hover td { background: var(--hover); }
tr.rowclick.is-on td { background: #e8eef5; }
td.cell-actions {
  white-space: nowrap;
  vertical-align: middle;
  width: 1%;
  overflow: visible;
  text-align: right;
}
td.cell-actions button { margin-right: 6px; }
td.cell-actions button:last-child { margin-right: 0; }
/* Keep the header over the buttons it labels. */
th.cell-actions { text-align: right; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.center, th.center { text-align: center; font-variant-numeric: tabular-nums; }
td.cell-when { white-space: nowrap; }
td.cell-donor {
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
}
td.cell-donor .muted { display: block; margin-top: 2px; }
td.cell-ref {
  overflow-wrap: anywhere;
  word-break: break-all;
  font-variant-numeric: tabular-nums;
}

.table-subs col.col-id { width: 72px; }
.table-subs col.col-donor { width: auto; }
.table-subs col.col-amt { width: 88px; }
.table-subs col.col-next { width: 118px; }
.table-subs col.col-vault { width: 92px; }
.table-subs col.col-status { width: 168px; }

/* Percentages so no column is left holding all the slack. */
.table-txns col.col-when { width: 15%; }
.table-txns col.col-amt { width: 10%; }
.table-txns col.col-ref { width: 20%; }
.table-txns col.col-n { width: 8%; }
.table-txns col.col-status { width: 13%; }
.table-txns col.col-code { width: 8%; }
.table-txns col.col-decision { width: 12%; }
.table-txns col.col-action { width: 14%; }

.table-retries col.col-when { width: 20%; }
.table-retries col.col-n { width: 9%; }
.table-retries col.col-stage { width: 15%; }
.table-retries col.col-status { width: 18%; }
.table-retries col.col-detail { width: 38%; }

.table-recon col.col-when { width: 15%; }
.table-recon col.col-donor { width: 20%; }
.table-recon col.col-amt { width: 10%; }
.table-recon col.col-ref { width: 18%; }
.table-recon col.col-status { width: 14%; }
.table-recon col.col-code { width: 8%; }
.table-recon col.col-decision { width: 15%; }

.table-days col.col-day { width: 40%; }
.table-days col.col-num { width: 20%; }

.table-users col.col-name { width: 28%; }
.table-users col.col-email { width: auto; }
.table-users col.col-created { width: 120px; }
.table-users col.col-action { width: 168px; }

.table-subs { min-width: 680px; }
.table-txns { min-width: 920px; }
.table-retries { min-width: 680px; }
.table-recon { min-width: 960px; }
.table-days { min-width: 560px; }
.table-users { min-width: 560px; }
.table-subs td:last-child,
.table-txns td:nth-child(5),
.table-retries td:nth-child(4),
.table-recon td:nth-child(5) {
  overflow: visible;
  white-space: nowrap;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.pager-meta { font-size: 13px; color: var(--muted); margin-right: 4px; }
.pager select { width: auto; min-width: 110px; }

.pill {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #fff;
  border-radius: 999px;
  cursor: inherit;
}
.pill.active { color: var(--ok); border-color: #a7d4bc; background: #f0faf4; }
.pill.overdue { color: var(--bad); border-color: #f0b6c4; background: #fff5f6; }
.pill.paused, .pill.cancelled, .pill.pending { color: var(--muted); }
.pill.delinquent { color: var(--bad); border-color: #f0b6c4; background: #fff5f6; }
.pill.completed { color: var(--ok); border-color: #a7d4bc; background: #f0faf4; }
.pill.soft_decline, .pill.unknown { color: var(--warn); border-color: #f3d5a8; background: #fff8ee; }
.pill.hard_decline, .pill.error, .pill.failed { color: var(--bad); border-color: #f0b6c4; background: #fff5f6; }

.lab-steps {
  margin: 12px 0 16px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
}
.lab-steps li { margin: 4px 0; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.form-grid .field { margin: 0; width: 100%; }
.form-grid .field-wide { grid-column: 1 / -1; }
.form-grid input,
.form-grid select {
  width: 100%;
  height: 40px;
  box-sizing: border-box;
}
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field-wide { grid-column: auto; }
}

.jobs { display: grid; gap: 14px; }
.job {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 12px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.job:last-of-type { border-bottom: 0; padding-bottom: 0; }
.job-n {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--gold);
  padding-top: 2px;
}
.log {
  margin: 0;
  padding: 12px 14px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  max-height: 240px;
  overflow: auto;
  color: #292524;
  cursor: text;
}

.detail-msg { min-height: 18px; margin: 8px 0 0; }

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(247, 245, 240, 0.72);
}
.app-loader.hidden { display: none; }
.app-loader-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: 0 8px 28px rgba(18, 48, 82, 0.12);
}
.app-loader-box p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid #d7d2c8;
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: cbn-spin 0.7s linear infinite;
}
@keyframes cbn-spin {
  to { transform: rotate(360deg); }
}
button.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
button.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(18, 48, 82, 0.2);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: cbn-spin 0.7s linear infinite;
}
body.is-busy { cursor: wait; }
body.is-busy button, body.is-busy a.btn { cursor: wait; }
body.modal-open { overflow: hidden; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#confirmModal { z-index: 100; }
.modal.hidden,
.modal[hidden] { display: none !important; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 48, 82, 0.46);
}
.modal-card {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(18, 48, 82, 0.2);
  padding: 22px 24px 20px;
}
.modal-card-sm { width: min(400px, 100%); }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.modal-head h2,
.modal-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}
.modal-fields {
  display: grid;
  gap: 12px;
  margin: 14px 0 8px;
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}
.modal-spacer { flex: 1; }

@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { min-height: 220px; padding: 28px; }
  .shell { grid-template-columns: 1fr; }
  .shell.nav-collapsed { grid-template-columns: 1fr; }
  .shell.nav-collapsed .side { display: none; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; }
  nav { flex-direction: row; flex-wrap: wrap; padding: 8px 8px 12px; }
  .side-meta { display: none; }
}
