:root {
  --amand-danger: #dc3545;
  --amand-muted: #6c757d;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--bs-tertiary-bg);
}

.login-card {
  width: min(420px, 100%);
  padding: 1.75rem;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background: var(--bs-body-bg);
  box-shadow: var(--bs-box-shadow);
}

.login-card .brand {
  width: 4rem;
  height: 4rem;
  display: block;
  border-radius: 1.25rem;
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
  border-radius: 0.75rem;
  background: transparent;
}

.brand-link {
  gap: 0.625rem;
}

.brand-link .brand-text {
  letter-spacing: 0;
}

.login-card h1 {
  margin: 0.75rem 0 0.25rem;
  font-size: 1.5rem;
}

.login-card p {
  margin-bottom: 0.75rem;
  color: var(--bs-secondary-color);
}

.login-card label,
.modal-panel label,
.editor-section label,
.result label {
  display: grid;
  gap: 0.375rem;
  margin-top: 0.875rem;
}

.login-card button {
  width: 100%;
  margin-top: 1.125rem;
}

.form-error {
  min-height: 1.25rem;
  margin: 0.625rem 0 0;
  color: var(--amand-danger);
  font-size: 0.8125rem;
}

.current-user {
  font-size: 0.8125rem;
  white-space: nowrap;
}

.app-sidebar .nav-link p,
.app-sidebar .brand-text {
  color: inherit;
}

.app-content .view,
.app-content .editor-shell {
  margin-bottom: 1rem;
}

.card-header,
.actions,
.footer-actions,
.row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
}

.actions,
.row-actions {
  flex-wrap: nowrap;
}

.row-actions {
  justify-content: flex-start;
}

.small-box {
  margin-bottom: 0;
}

.small-box .inner h3,
.small-box .inner p {
  color: inherit;
}

.table {
  min-width: 1180px;
  table-layout: fixed;
}

.log-table {
  min-width: 1280px;
}

.scheduler-table {
  min-width: 1180px;
}

.table th {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  font-weight: 700;
}

.sort-header {
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.sort-header:hover {
  color: var(--bs-primary);
}

.url-cell {
  max-width: 420px;
}

.url-cell span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: help;
}

.actions-cell {
  width: 260px;
  min-width: 260px;
}

.status-badge {
  display: inline-block;
  min-width: 4rem;
  border-radius: var(--bs-border-radius-pill);
  padding: 0.3125rem 0.5625rem;
  color: #997404;
  background: #fff3cd;
  font-size: 0.75rem;
  text-align: center;
}

.status-badge.on {
  color: #0f5132;
  background: #d1e7dd;
}

.status-badge.danger-badge {
  color: #842029;
  background: #f8d7da;
}

.mono {
  font-family: var(--bs-font-monospace);
  font-size: 0.75rem;
}

.empty-cell {
  padding: 2.25rem 0.625rem;
  text-align: center;
  color: var(--bs-secondary-color);
}

.usage {
  display: grid;
  gap: 0.375rem;
  min-width: 110px;
}

.usage span {
  font-size: 0.8125rem;
}

.usage::after {
  content: "";
  height: 0.375rem;
  border-radius: var(--bs-border-radius-pill);
  background: var(--bs-secondary-bg);
  grid-row: 2;
}

.usage i {
  display: block;
  height: 0.375rem;
  max-width: 100%;
  border-radius: var(--bs-border-radius-pill);
  background: var(--bs-primary);
  grid-row: 2;
  grid-column: 1;
  z-index: 1;
}

.dashboard-chart {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1rem;
  align-items: center;
  min-height: 9.5rem;
}

.donut-chart {
  width: 8.5rem;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.donut-chart::after {
  content: "";
  position: absolute;
  inset: 1.35rem;
  border-radius: 50%;
  background: var(--bs-body-bg);
}

.donut-chart strong,
.donut-chart span {
  position: relative;
  z-index: 1;
  line-height: 1.1;
}

.donut-chart strong {
  font-size: 1.65rem;
}

.donut-chart span {
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
  transform: translateY(1.25rem);
}

.chart-legend {
  display: grid;
  gap: 0.65rem;
}

.legend-row {
  display: grid;
  grid-template-columns: 0.75rem 1fr auto;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.875rem;
}

.legend-row i {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.45rem;
  align-items: end;
  min-height: 9.5rem;
}

.bar-item {
  min-height: 2.5rem;
  border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 0.35rem 0.125rem;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.bar-item.success {
  height: 8rem;
  background: var(--bs-success);
}

.bar-item.failed {
  height: 5.25rem;
  background: var(--bs-danger);
}

.bar-item.running {
  height: 6.5rem;
  background: var(--bs-primary);
}

.empty-mini {
  grid-column: 1 / -1;
  align-self: center;
  color: var(--bs-secondary-color);
  text-align: center;
}

.editor-shell {
  display: grid;
  grid-template-columns: minmax(680px, 1.35fr) minmax(380px, 0.65fr);
  gap: 1rem;
  align-items: start;
}

.editor {
  overflow: hidden;
}

.editor .footer-actions {
  background: var(--bs-body-bg);
}

.editor-section {
  padding: 1rem;
  border-bottom: 1px solid var(--bs-border-color);
}

.editor-section:last-of-type {
  border-bottom: 0;
}

.editor-section h4 {
  margin: 0 0 0.75rem;
  padding-left: 0.625rem;
  border-left: 3px solid var(--bs-primary);
  font-size: 0.95rem;
  font-weight: 700;
}

.editor-section .field-help {
  color: var(--bs-secondary-color);
  line-height: 1.5;
}

.grid {
  display: grid;
  gap: 0.75rem;
}

.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.one {
  grid-template-columns: minmax(0, 1fr);
}

label span {
  font-size: 0.8125rem;
  font-weight: 600;
}

label span.required::after {
  content: " *";
  color: var(--amand-danger);
  font-weight: 700;
}

.field-help {
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
  line-height: 1.5;
}

button.btn {
  font-weight: 600;
  white-space: nowrap;
}

.icon-button {
  width: 2.125rem;
  min-height: 2.125rem;
  padding: 0;
  display: grid;
  place-items: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1055;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.45);
}

.modal.hidden {
  display: none;
}

.modal-panel {
  width: min(860px, 100%);
  max-height: calc(100vh - 3rem);
  overflow: auto;
  border-radius: var(--bs-border-radius);
  background: var(--bs-body-bg);
  box-shadow: var(--bs-box-shadow-lg);
  border: 1px solid var(--bs-border-color);
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
}

.modal-head {
  border-bottom: 1px solid var(--bs-border-color);
}

.modal-foot {
  border-top: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg);
}

.modal-body {
  padding: 0.25rem 1.25rem 1.25rem;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.toggle input {
  width: 1.125rem;
  height: 1.125rem;
}

.status {
  border-radius: var(--bs-border-radius-pill);
  background: var(--bs-secondary-bg);
  padding: 0.3125rem 0.625rem;
  font-size: 0.75rem;
}

.status.running {
  color: #997404;
  background: #fff3cd;
}

.status.ok {
  color: #0f5132;
  background: #d1e7dd;
}

.status.error {
  color: #842029;
  background: #f8d7da;
}

.test-steps {
  display: grid;
  gap: 0.625rem;
  margin-bottom: 1rem;
}

.test-step {
  display: grid;
  grid-template-columns: 0.875rem minmax(0, 1fr) auto;
  gap: 0.625rem;
  align-items: start;
  padding: 0.75rem;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background: var(--bs-tertiary-bg);
}

.test-step-dot {
  width: 0.625rem;
  height: 0.625rem;
  margin-top: 0.375rem;
  border-radius: 999px;
  background: var(--bs-secondary-color);
}

.test-step strong {
  display: block;
  font-size: 0.875rem;
}

.test-step p {
  margin: 0.125rem 0 0;
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
  line-height: 1.45;
  word-break: break-all;
}

.test-step em {
  font-style: normal;
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
  white-space: nowrap;
}

.test-step.running {
  border-color: rgba(var(--bs-warning-rgb), 0.45);
  background: rgba(var(--bs-warning-rgb), 0.12);
}

.test-step.running .test-step-dot {
  background: var(--bs-warning);
}

.test-step.done {
  border-color: rgba(var(--bs-success-rgb), 0.35);
}

.test-step.done .test-step-dot {
  background: var(--bs-success);
}

.test-step.failed {
  border-color: rgba(var(--bs-danger-rgb), 0.45);
  background: rgba(var(--bs-danger-rgb), 0.12);
}

.test-step.failed .test-step-dot {
  background: var(--bs-danger);
}

.test-step.skipped {
  opacity: 0.72;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0.875rem 0 0;
  padding: 0.75rem;
  background: var(--bs-tertiary-bg);
  border-radius: var(--bs-border-radius);
  color: var(--bs-body-color);
  font-size: 0.75rem;
}

@media (max-width: 1180px) {
  .editor-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .two,
  .three {
    grid-template-columns: 1fr;
  }

  .dashboard-chart {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .chart-legend {
    width: 100%;
  }

  .modal-head,
  .modal-foot {
    align-items: flex-start;
    flex-direction: column;
  }
}
