.page-matrix {
  min-height: 100vh;
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.5rem;
}

.matrix-panel {
  max-width: 24rem;
  margin: 4rem auto;
  padding: 1.5rem;
  background: #1e293b;
  border-radius: 12px;
  border: 1px solid #334155;
}

.matrix-panel h1,
.matrix-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.matrix-lead {
  margin: 0 0 1rem;
  color: #94a3b8;
  font-size: 0.9rem;
}

.matrix-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0.75rem 0 0.25rem;
}

.matrix-panel input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #475569;
  background: #0f172a;
  color: #f8fafc;
}

.matrix-panel .btn {
  margin-top: 1rem;
  width: 100%;
}

.matrix-error {
  color: #fca5a5;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

.matrix-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.matrix-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.matrix-muted {
  color: #94a3b8;
  font-size: 0.8rem;
}

.matrix-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.matrix-stat {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  min-width: 7rem;
}

.matrix-stat strong {
  display: block;
  font-size: 1.4rem;
  line-height: 1.2;
}

.matrix-stat span {
  font-size: 0.75rem;
  color: #94a3b8;
}

.matrix-table-wrap {
  overflow: auto;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #1e293b;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.matrix-table th,
.matrix-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #334155;
  text-align: left;
  vertical-align: middle;
}

.matrix-table th {
  background: #0f172a;
  color: #cbd5e1;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.matrix-table tr:last-child td {
  border-bottom: none;
}

.matrix-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.matrix-badge--ok { background: #14532d; color: #86efac; }
.matrix-badge--degraded { background: #713f12; color: #fde68a; }
.matrix-badge--down { background: #7f1d1d; color: #fecaca; }
.matrix-badge--unknown { background: #334155; color: #cbd5e1; }

.matrix-kind {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.matrix-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.matrix-links a {
  color: #7dd3fc;
  text-decoration: none;
  font-size: 0.8rem;
}

.matrix-links a:hover {
  text-decoration: underline;
}

.matrix-footnote {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #64748b;
}

.matrix-footnote code {
  color: #94a3b8;
}

.matrix-empty {
  text-align: center;
  color: #94a3b8;
  padding: 1.5rem !important;
}

.matrix-toolbar {
  margin-bottom: 0.85rem;
}

.matrix-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: 28rem;
  width: calc(100% - 2rem);
  background: #1e293b;
  color: #e2e8f0;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.matrix-dialog--wide {
  max-width: 42rem;
}

.matrix-dialog::backdrop {
  background: rgba(15, 23, 42, 0.75);
}

.matrix-dialog form,
.matrix-dialog {
  padding: 1.1rem 1.15rem 1rem;
}

.matrix-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.matrix-dialog-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.matrix-dialog-close {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
}

.matrix-form-grid {
  display: grid;
  gap: 0.35rem 0.75rem;
  margin: 0.75rem 0;
}

.matrix-form-grid input,
.matrix-form-grid select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #475569;
  background: #0f172a;
  color: #f8fafc;
}

.matrix-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  margin: 0.5rem 0;
}

.matrix-preflight {
  margin: 0.65rem 0;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: #0f172a;
  border: 1px solid #334155;
  font-size: 0.82rem;
}

.matrix-preflight-row {
  margin: 0.2rem 0;
}

.matrix-preflight-ok strong { color: #86efac; }
.matrix-preflight-bad strong { color: #fca5a5; }

.matrix-preflight-warn {
  margin: 0.45rem 0 0;
  color: #fde68a;
  font-size: 0.8rem;
}

.matrix-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.matrix-job-status {
  margin: 0.35rem 0 0.65rem;
}

.matrix-job-log {
  max-height: 14rem;
  overflow: auto;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  font-size: 0.72rem;
  line-height: 1.35;
  white-space: pre-wrap;
  color: #cbd5e1;
}

.matrix-job-creds {
  margin-bottom: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: #14532d;
  border: 1px solid #166534;
  font-size: 0.85rem;
}

.matrix-job-creds h3 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
}

.matrix-job-creds code {
  color: #bbf7d0;
}

.matrix-badge--queued,
.matrix-badge--running {
  background: #1e3a5f;
  color: #93c5fd;
}

.matrix-badge--succeeded {
  background: #14532d;
  color: #86efac;
}

.matrix-badge--failed {
  background: #7f1d1d;
  color: #fecaca;
}
