body { min-height: 100vh; }
.card { border-radius: .85rem; }
.status { display: inline-flex; align-items: center; padding: .2rem .55rem; border-radius: 99px; font-size: .75rem; font-weight: 700; }
.status-running { color: #146c43; background: #d1e7dd; }
.status-stopped { color: #41464b; background: #e2e3e5; }
.status-missing { color: #41464b; background: #e9ecef; }
.status-incomplete { color: #842029; background: #f8d7da; }
.status-error { color: #842029; background: #f8d7da; }
.status-unknown { color: #41464b; background: #e2e3e5; }
input[type="checkbox"].form-control { width: auto; }

.mfa-card input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]) {
  display: block;
  width: 100%;
  padding: .375rem .75rem;
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
  background-clip: padding-box;
  border: var(--bs-border-width) solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  appearance: none;
}

.mfa-card input:focus {
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
}

.mfa-qr-panel {
  display: flex;
  justify-content: center;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: .75rem;
}

.mfa-qr-code {
  display: block;
  width: min(100%, 18rem);
  height: auto;
}

.application-table {
  display: grid;
  gap: .4rem;
  width: 100%;
  overflow-x: auto;
  padding: .15rem;
}

.application-table-header,
.application-row {
  display: grid;
  grid-template-columns: minmax(12rem, 1.35fr) minmax(12rem, 1.35fr) minmax(9rem, .85fr) minmax(9rem, .85fr) minmax(12rem, 1fr) 5rem;
  align-items: center;
  column-gap: 1rem;
  min-width: 68rem;
}

.application-table-header {
  padding: 0 1.1rem .3rem;
  color: var(--bs-secondary-color);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.application-row {
  min-height: 3.5rem;
  padding: .55rem 1.1rem;
  background: #fff;
  border: 1px solid #ced4da;
  border-left: .25rem solid var(--bs-primary);
  border-radius: .65rem;
  box-shadow: 0 .12rem .3rem rgba(33, 37, 41, .09);
}

.application-row:hover {
  border-color: rgba(var(--bs-primary-rgb), .55);
  border-left-color: var(--bs-primary);
  box-shadow: 0 .22rem .55rem rgba(33, 37, 41, .13);
  transform: translateY(-1px);
}

.application-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .7rem;
  line-height: 1.25;
}

.application-identity-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.application-identity-text span,
.application-domain {
  color: var(--bs-secondary-color);
  font-size: .8rem;
}

.site-logo {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: .55rem;
}

.site-logo-small {
  width: 2.25rem;
  height: 2.25rem;
  padding: .2rem;
}

.site-logo-large {
  width: 4.5rem;
  height: 4.5rem;
  padding: .35rem;
}

.logo-editor {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-logo-preview {
  width: 9rem;
  height: 7rem;
  padding: .6rem;
}

.logo-placeholder {
  align-items: center;
  justify-content: center;
  color: var(--bs-secondary-color);
  font-size: .85rem;
}

.logo-upload-form {
  width: min(100%, 32rem);
}

@media (max-width: 575.98px) {
  .logo-editor {
    align-items: stretch;
    flex-direction: column;
    gap: 1rem;
  }
}

.component-state {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  font-weight: 600;
}

.component-state::before {
  width: .45rem;
  height: .45rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #6c757d;
  content: "";
}

.component-state-running::before { background: #198754; }
.component-state-error::before { background: #dc3545; }
.component-state-stopped::before,
.component-state-missing::before,
.component-state-unknown::before { background: #6c757d; }

.application-action {
  justify-self: end;
}

.application-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding: 2.5rem 1rem;
  color: var(--bs-secondary-color);
  text-align: center;
  background: var(--bs-body-bg);
  border: 1px dashed var(--bs-border-color);
  border-radius: .75rem;
}

.confirmation-icon {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 700;
}

.confirmation-icon-warning {
  color: #664d03;
  background: #fff3cd;
}

.confirmation-icon-danger {
  color: #842029;
  background: #f8d7da;
}

.refresh-countdown {
  position: relative;
  width: 3.25rem;
  height: 3.25rem;
  flex: 0 0 auto;
}

.refresh-countdown svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.refresh-countdown circle {
  fill: none;
  stroke-width: 4;
}

.refresh-countdown-track {
  stroke: var(--bs-border-color);
}

.refresh-countdown-progress {
  stroke: var(--bs-primary);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  animation: refresh-countdown-empty 6s linear forwards;
}

.refresh-countdown span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--bs-primary);
  font-size: .9rem;
  font-weight: 700;
}

@keyframes refresh-countdown-empty {
  to { stroke-dashoffset: 100; }
}

.deployment-result {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1rem;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
}

.deployment-result-success { background: var(--bs-success); }
.deployment-result-failed,
.deployment-result-partial_failure { background: var(--bs-danger); }

.deployment-loader .refresh-countdown-progress {
  stroke: var(--bs-success);
}

.deployment-loader span {
  color: var(--bs-success);
}

.deployment-log {
  max-height: 14rem;
  overflow: auto;
  margin-bottom: 1rem;
  padding: .75rem;
  color: #d1e7dd;
  background: #212529;
  border-radius: .4rem;
  font-size: .75rem;
  white-space: pre-wrap;
}

@media (prefers-reduced-motion: reduce) {
  .refresh-countdown-progress {
    animation: none;
  }
}

@media (max-width: 1199.98px) {
  .application-table {
    padding-bottom: .55rem;
  }
}
