/* popover form lives on white bg, reset for readability */
.app-add-link > form label {
  color: var(--muted);
}

.app-add-link > form input,
.app-add-link > form select,
.app-add-link > form textarea {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.sidebar .stacked-form.compact button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 0.76rem;
}

.sidebar .empty-line {
  margin: 4px 0 6px;
  font-size: 0.72rem;
  color: var(--nav-muted);
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.check-label {
  display: flex;
  align-items: center;
  min-height: 28px;
  gap: 7px;
  color: var(--ink);
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 32px;
  padding: 6px 8px;
  background: #fff;
  color: var(--ink);
  font-size: 0.86rem;
}

.check-label input[type="checkbox"] {
  width: 14px;
  min-width: 14px;
  height: 14px;
  min-height: 14px;
  margin: 0;
  padding: 0;
}

textarea {
  resize: vertical;
}

.wide {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.csr-workflow-steps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workflow-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: var(--surface-2);
}

.workflow-step strong,
.workflow-step small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.workflow-step strong {
  font-weight: 600;
}

.workflow-step small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.3;
}

.step-index {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.workflow-step.is-complete .step-index {
  border-color: #b9dfcf;
  background: #eaf7f1;
  color: var(--green);
}

.workflow-step.needs-attention .step-index {
  border-color: #ead7a5;
  background: #fff8e8;
  color: var(--amber);
}

.workflow-step.is-blocked .step-index {
  border-color: #d8dee8;
  background: #edf1f6;
  color: var(--muted);
}

.artifact-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.artifact-summary div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: var(--surface-2);
}

.artifact-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
}

.artifact-summary strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
  font-weight: 600;
}

.advanced-renew-options {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.advanced-renew-options summary {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  list-style: none;
}

.advanced-renew-options summary::-webkit-details-marker {
  display: none;
}

.advanced-renew-options[open] summary {
  border-bottom: 1px solid var(--line);
}

.renew-artifact-grid {
  padding: 10px;
}

.jboss-renew-artifact-grid {
  grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  gap: 9px;
  padding: 11px;
}

.renew-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.renew-action-bar form {
  margin: 0;
}

/* Desktop Renew workspace: primary controls and readiness stay together on
   the left while run history remains visible in the right-hand column. */
@media (min-width: 1081px) {
  .renew-layout {
    grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
  }

  .renew-layout > .renew-command-panel {
    grid-column: 1;
    grid-row: 1;
  }

  .renew-layout > .renew-ready-panel {
    grid-column: 1;
    grid-row: 2;
  }

  .renew-layout > .renew-recent-panel {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

.compact-detail-list {
  margin-bottom: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.status-pill.healthy {
  border-color: #b9dfcf;
  background: #eaf7f1;
  color: var(--green);
}

.status-pill.warning {
  border-color: #ead7a5;
  background: #fff8e8;
  color: var(--amber);
}

.status-pill.danger {
  border-color: #ecc2c2;
  background: #fff7f7;
  color: var(--red);
}

.status-pill.checking {
  border-color: #c8d7ef;
  background: #f2f7ff;
  color: #244c84;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.renew-primary-button,
.renew-secondary-button {
  min-height: 34px;
  padding: 0 14px;
}

.renew-primary-button {
  box-shadow: 0 8px 18px rgb(39 95 159 / 18%);
}

.renew-secondary-button {
  border: 1px solid #c8d7ef;
  background: #f2f7ff;
  color: var(--blue);
}

.renew-secondary-button:disabled {
  border-color: transparent;
  background: #9aa4b2;
  color: #fff;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.button-row form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.csr-action-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: var(--surface-2);
}

.csr-action-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.csr-action-form > button {
  white-space: nowrap;
}

.csr-action-form button {
  margin-left: auto;
}

.csr-action-form + .csr-action-form {
  border-left: 1px solid var(--line);
  padding-left: 12px;
}

.csr-action-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
}

.toggle-line {
  display: inline-flex;
  grid-template-columns: unset;
  align-items: center;
  gap: 6px;
  width: auto;
  min-height: 28px;
  color: var(--ink);
  cursor: pointer;
}

.toggle-line input {
  position: absolute;
  width: 1px;
  min-height: 0;
  height: 1px;
  padding: 0;
  opacity: 0;
}

.toggle-ui {
  position: relative;
  width: 30px;
  height: 16px;
  border: 1px solid #aeb7c5;
  border-radius: 999px;
  background: #dfe5ee;
  transition:
    background 120ms ease,
    border-color 120ms ease;
}

.toggle-ui::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(21 25 34 / 18%);
  content: "";
  transition: transform 120ms ease;
}

.toggle-line input:checked + .toggle-ui {
  border-color: var(--blue);
  background: var(--blue);
}

.toggle-line input:checked + .toggle-ui::after {
  transform: translateX(14px);
}

.toggle-line input:focus-visible + .toggle-ui {
  outline: 2px solid #9bbce8;
  outline-offset: 2px;
}

.stream-panel {
  overflow: hidden;
  border: 1px solid #263244;
  border-radius: 6px;
  background: #101722;
  color: #d8e1ee;
}

.stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #263244;
  padding: 8px 10px;
  font-size: 0.78rem;
}

.stream-header span {
  color: #9bbce8;
  font-weight: 600;
  text-transform: uppercase;
}

.stream-header strong {
  font-weight: 600;
}

.stream-panel pre {
  max-height: 280px;
  margin: 0;
  overflow: auto;
  padding: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.approval-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
}

.approval-modal[hidden] {
  display: none;
}

.approval-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgb(17 24 39 / 60%);
}

.approval-modal__dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: min(80vh, 780px);
  display: grid;
  gap: 10px;
  overflow: hidden;
  border: 1px solid #263244;
  border-radius: 8px;
  padding: 12px;
  background: #111a28;
  color: #d5dfeb;
  z-index: 41;
}

.approval-modal__dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.approval-modal__dialog header button {
  min-height: 26px;
  min-width: 26px;
  padding: 0;
  font-size: 1.05rem;
}

.approval-modal__subtitle {
  margin: 0;
  color: #9eb0cb;
  font-size: 0.82rem;
}

.approval-modal__plan {
  margin: 0;
  min-height: 180px;
  overflow: auto;
  padding: 10px;
  border: 1px solid #263244;
  border-radius: 6px;
  background: #0b1320;
  color: #d6e2f2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.74rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

.approval-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.workflow-approval-dialog {
  width: min(520px, calc(100vw - 40px));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 70px rgb(21 35 49 / 28%);
}

.workflow-approval-dialog::backdrop { background: rgb(21 35 49 / 58%); }
.workflow-approval-dialog form { display: grid; gap: 16px; padding: 20px; }
.workflow-approval-dialog header { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.workflow-approval-dialog h2 { margin: 3px 0 0; font-size: 1.18rem; }
.workflow-approval-dialog p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.workflow-approval-dialog label { display: grid; gap: 7px; color: var(--ink); font-size: .78rem; font-weight: 650; }
.workflow-approval-dialog input { width: 100%; }
.workflow-approval-dialog footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.workflow-approval-dialog .icon-only-button { width: 32px; min-height: 32px; padding: 0; }
.workflow-action-info-lead { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.workflow-action-info-points {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.4rem;
  color: var(--ink);
  font-size: .84rem;
  line-height: 1.45;
}
.workflow-action-info-dialog .info-note { margin: 0; }
.stream-info {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2, #f8fafc);
  display: grid;
  gap: 6px;
  font-size: .82rem;
  line-height: 1.45;
}
.stream-info strong { font-size: .9rem; }
.stream-info p { margin: 0; color: var(--muted); }
.stream-info ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.25rem; }
.renew-action-help { margin: 0 0 12px; font-size: .82rem; }
.renew-action-bar { flex-wrap: wrap; align-items: center; gap: 8px; }
.renew-rollback-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.renew-backup-id-field input {
  width: 10.5rem;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .82rem;
}

.check-line {
  display: flex;
  grid-template-columns: unset;
  align-items: center;
  gap: 6px;
}

.check-line input {
  width: auto;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.artifact-matrix {
  table-layout: fixed;
}

.artifact-matrix th:nth-child(1) {
  width: 17%;
}

.artifact-matrix th:nth-child(2) {
  width: 21%;
}

.artifact-matrix th:nth-child(3) {
  width: 29%;
}

.artifact-matrix th:nth-child(4) {
  width: 14%;
}

.artifact-matrix th:last-child {
  width: 19%;
}

.artifact-matrix td {
  vertical-align: middle;
}

.artifact-matrix td:nth-child(2) {
  overflow-wrap: anywhere;
}

.artifact-matrix input[type="file"] {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 28px;
  font-size: 0.68rem;
}

.artifact-matrix input[type="file"]::file-selector-button {
  margin-right: 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 6px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.68rem;
}

.artifact-matrix-submit {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.artifact-matrix-submit button {
  min-width: 220px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
  font-size: 0.84rem;
}

th {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}

thead {
  background: var(--surface-2);
}

tbody tr:hover {
  background: #f8fafc;
}

tbody tr:last-child td {
  border-bottom: 0;
}

th:last-child,
td:last-child {
  width: 1%;
  white-space: nowrap;
}

.text-link {
  color: var(--blue);
  font-weight: 600;
}

.artifact-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
}

.artifact-actions .text-link,
.artifact-actions .link-button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  font-size: 0.72rem;
}

.artifact-actions .ui-icon {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
}

.artifact-actions form {
  margin: 0;
}

.link-button {
  min-height: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 600;
}

.link-button:hover {
  filter: none;
  text-decoration: underline;
}

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

.job-list {
  display: grid;
  gap: 6px;
}

.job-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.job-row__summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  align-items: center;
  min-width: 0;
  padding: 7px 9px;
  font-size: 0.84rem;
}

.job-row__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-row__summary small {
  grid-column: 1 / 3;
  grid-row: 2;
  color: var(--muted);
  white-space: nowrap;
}

.job-row__summary strong {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  align-self: center;
  min-height: 27px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.job-log-open {
  grid-column: 3;
  grid-row: 1 / span 2;
  min-height: 27px;
  padding: 0 9px;
  font-size: 0.75rem;
}

.config-note strong,
.info-note strong {
  font-weight: 600;
}

.job-row__summary strong.succeeded {
  color: var(--green);
}

.job-row__summary strong.failed,
.job-row__summary strong.blocked {
  color: var(--red);
}

.workflow-target {
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 10px;
  background: var(--surface-2);
}

.config-note {
  display: grid;
  gap: 4px;
  border: 1px solid #ead7a5;
  border-radius: 6px;
  padding: 8px 9px;
  background: #fff8e8;
  color: #7a5413;
  font-size: 0.82rem;
}

.info-note {
  display: grid;
  gap: 4px;
  border: 1px solid #c8d7ef;
  border-radius: 6px;
  padding: 8px 9px;
  background: #f2f7ff;
  color: #244c84;
  font-size: 0.82rem;
}

.config-note code {
  font-size: 0.78rem;
}

.config-note ul {
  margin: 2px 0 0;
  padding-left: 18px;
}

.config-note li {
  margin: 2px 0;
}

.empty-line,
.empty-state {
  color: var(--muted);
}

.sidebar-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px 6px;
}

.sidebar-search input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 28px;
  padding: 4px 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 5px;
  color: #ffffff;
  font-size: 0.78rem;
}

.sidebar-search .sidebar-toggle {
  flex: 0 0 30px;
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.1);
  color: #ffffff;
}

.sidebar-search .sidebar-toggle:hover {
  background: rgba(255,255,255,0.18);
}

.sidebar-search input::placeholder {
  color: rgba(255,255,255,0.35);
}

.sidebar-search input:focus-visible {
  outline: 2px solid rgba(255,255,255,0.4);
  outline-offset: 1px;
  background: rgba(255,255,255,0.14);
}

/* project-level delete (kept for settings page use if needed) */
.app-tree-header:hover .sidebar-delete {
  opacity: 1;
}
