*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: #1f2937;
  background: #f4f5f7;
  font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }

.layout-header {
  position: sticky; top: 0; z-index: 10; height: 52px; padding: 0 24px;
  display: flex; align-items: center; gap: 16px; background: #fff; border-bottom: 1px solid #e5e7eb;
}
.layout-title { font-weight: 700; color: #111827; white-space: nowrap; }
.layout-nav { display: flex; gap: 4px; flex: 1; }
.tab { border: 1px solid transparent; background: transparent; color: #4b5563; border-radius: 5px;
  padding: 6px 14px; cursor: pointer; }
.tab:hover { background: #f3f4f6; }
.tab.active { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.layout-user { display: flex; align-items: center; gap: 10px; color: #6b7280; font-size: 13px; }
.body { width: 100%; padding: 28px 24px; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 380px); padding: 32px; background: #fff; border-radius: 8px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.12); }
.login-card h1 { margin: 0 0 20px; font-size: 20px; }

.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 20px; margin-bottom: 20px; }
.card h2 { margin: 0 0 14px; font-size: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 12px; color: #4b5563; font-weight: 600; }
input, select { border: 1px solid #d1d5db; border-radius: 5px; padding: 7px 10px; background: #fff; min-width: 0; }
input:focus, select:focus { outline: 2px solid #bfdbfe; border-color: #3b82f6; }

.btn { border: 1px solid #d1d5db; background: #fff; color: #111827; border-radius: 5px; padding: 7px 14px;
  cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f9fafb; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.btn.primary:hover { background: #1e40af; }
.btn.danger { color: #b91c1c; border-color: #fecaca; }
.btn.small { padding: 3px 9px; font-size: 12px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #f0f1f3; vertical-align: middle; }
th { font-size: 12px; color: #6b7280; font-weight: 600; background: #fafafa; }
td .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }

.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #f3f4f6; color: #374151; }
.pill.ok { background: #dcfce7; color: #166534; }
.pill.bad { background: #fee2e2; color: #991b1b; }
.pill.warn { background: #fef3c7; color: #92400e; }
.pill.run { background: #dbeafe; color: #1e40af; }

.note { color: #6b7280; font-size: 13px; }
.msg { padding: 9px 12px; border-radius: 6px; margin-bottom: 14px; }
.msg.ok { background: #ecfdf5; color: #065f46; }
.msg.bad { background: #fef2f2; color: #991b1b; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.steps { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.steps li { margin: 2px 0; }
a { color: #1d4ed8; }

@media (max-width: 700px) {
  .layout-header { height: auto; flex-wrap: wrap; padding: 10px 16px; }
  .body { padding: 18px 16px; }
}

/* Card header: title, filters and the main action on one line. */
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grow { flex: 1; }
.btn.danger-solid { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn.danger-solid:hover { background: #991b1b; }
.btn:disabled:hover { background: inherit; }

/* Dialogs (the Accent console's): one form, its own error line, Cancel / Save pinned at the bottom. */
.modal-overlay { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px;
  background: rgba(15, 23, 42, 0.35); }
.modal { width: min(100%, 460px); max-height: calc(100vh - 40px); overflow-y: auto; background: #fff;
  border-radius: 8px; padding: 24px 24px 0; box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18); }
.modal-wide { width: min(100%, 680px); }
.modal h2 { margin: 0 0 14px; font-size: 17px; }
.modal-form { display: grid; gap: 14px; }
.modal-sub { margin: 0; color: #4b5563; font-size: 13px; line-height: 1.5; }
.modal-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: #374151; }
.modal-field input, .modal-field select { font-size: 14px; font-weight: 400; padding: 8px 10px; }
.modal-field input:disabled, .modal-field select:disabled { background: #f3f4f6; color: #6b7280; }
.modal-field small { font-weight: 400; color: #6b7280; font-size: 12px; }
.modal-field input:invalid:not(:placeholder-shown) { border-color: #f87171; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #374151; }
.choices { display: grid; gap: 8px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid #e5e7eb;
  border-radius: 6px; cursor: pointer; }
.choice:has(input:checked) { border-color: #93c5fd; background: #eff6ff; }
.choice input { margin-top: 3px; }
.choice span { display: flex; flex-direction: column; gap: 2px; }
.choice small { color: #6b7280; font-size: 12px; }
.modal .msg { margin: 0; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 6px;
  position: sticky; bottom: 0; padding: 12px 0 20px; background: #fff; border-top: 1px solid #e5e7eb; }
.modal-footer-left { margin-right: auto; display: flex; gap: 8px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
/* A build's step list opens in a full-width row under it, in two columns on a wide screen. */
.steps-row td { background: #fafbfc; padding: 4px 10px 12px; }
.steps-row .steps { columns: 2 320px; margin: 6px 0 0; }
.steps-row .steps li { break-inside: avoid; }
