/* Super admin pages: audit log, permissions matrix, app releases. */

/* Audit log */
.audit-row {
  cursor: pointer;
}

.audit-summary:hover,
.audit-summary:focus-visible {
  text-decoration: underline !important;
}

.audit-system {
  background-color: var(--bs-secondary-bg);
  color: var(--bs-secondary-color);
}

.audit-detail {
  --bs-offcanvas-width: min(520px, 100vw);
}

.audit-before {
  background-color: rgba(var(--bs-danger-rgb), .06);
}

.audit-after {
  background-color: rgba(var(--bs-success-rgb), .08);
}

/* Admin > Users > Plan: the add-on checklist isn't checked by the browser, so it keeps its colours when the form shows validation. */
.was-validated #plan-addons .form-check-input:valid { border-color: var(--bs-border-color); }
.was-validated #plan-addons .form-check-input:valid:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.was-validated #plan-addons .form-check-input:valid ~ .form-check-label { color: inherit; }
.was-validated #plan-addons .form-control:valid { border-color: var(--bs-border-color); background-image: none; }

/* ---------------- App releases: the APK upload ---------------- */

.apk-drop-target {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  width: 100%;
  min-height: 7.5rem;
  padding: 1.25rem 1rem;
  border: 2px dashed var(--bs-border-color);
  border-radius: .75rem;
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}

.apk-drop-target:hover,
.apk-drop-over .apk-drop-target {
  border-color: var(--bs-primary);
  background: var(--bs-primary-bg-subtle);
}

.apk-drop-target:focus-visible {
  outline: 3px solid rgba(var(--bs-primary-rgb), .4);
  outline-offset: 2px;
}

.apk-drop-target.is-invalid {
  border-color: var(--bs-danger);
}

.apk-drop-icon {
  --icon-size: 1.75rem;
  color: var(--bs-primary);
}

.apk-card {
  padding: 1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: .75rem;
}

.apk-card-done {
  border-color: var(--bs-success-border-subtle);
  background: var(--bs-success-bg-subtle);
}

.apk-done-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: #fff;
  background: var(--bs-success);
}

.apk-done-icon .icon {
  --icon-size: 1rem;
}

/* Small links in the cards still get a 44px target. */
.apk-stop,
.apk-replace {
  min-height: 44px;
  white-space: nowrap;
}

.apk-progress-text {
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .apk-drop-target {
    transition: none;
  }

  #apk-bar .progress-bar {
    transition: none;
  }
}

.permission-matrix .table-group th {
  background-color: var(--bs-tertiary-bg);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .75rem;
}

/* App releases: the switch between the apps, big enough to tap. */
.app-switch .btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Three apps don't fit side by side on a phone at their full padding: the switch takes the width, shared evenly. */
@media (max-width: 575.98px) {
  .app-switch {
    width: 100%;
  }

  .app-switch .btn {
    flex: 1 1 0;
    justify-content: center;
    padding-inline: .5rem;
    font-size: .875rem;
  }
}
