/* Small layout tweaks on top of Bootstrap. Prefer Bootstrap utilities over adding rules here. */
/*
  Sidebar (templates/app_base.html, templates/includes/sidebar.html).
  Every row is an icon in a fixed 2rem box followed by a .sidebar-label, so the icons line up
  in one column. On large screens the sidebar is a 4rem rail of icons; while the pointer or
  keyboard focus is in it (or its user menu is open) the panel widens over the page and the
  labels fade in. Below lg it's the Bootstrap offcanvas menu and these width rules don't apply.
*/
.sidebar .nav-link,
.sidebar-brand,
.sidebar-user {
  display: flex;
  align-items: center;
  padding-inline: 0.5rem;
  white-space: nowrap;
}
.sidebar .nav-item,
.sidebar-label {
  min-width: 0;
}
.sidebar .nav-link {
  overflow: hidden;
}
.sidebar-icon {
  flex-shrink: 0;
  width: 2rem;
  margin-right: 0.5rem;
  text-align: center;
}
@media (min-width: 992px) {
  .sidebar {
    --sidebar-rail-width: 4rem;
    --sidebar-width: 260px;
    position: relative;
    z-index: 1030;
    flex-shrink: 0;
    width: var(--sidebar-rail-width);
    border-right: 0 !important;
  }
  .sidebar .sidebar-panel {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--sidebar-rail-width);
    overflow: hidden auto;
    background-color: var(--bs-tertiary-bg) !important;
    border-right: var(--bs-border-width) solid var(--bs-border-color);
  }
  .sidebar .sidebar-label,
  .sidebar .sidebar-user::after {
    opacity: 0;
  }
  .sidebar:hover .sidebar-panel,
  .sidebar:has(:focus-visible) .sidebar-panel,
  .sidebar:has(.dropdown-menu.show) .sidebar-panel {
    width: var(--sidebar-width);
    box-shadow: var(--bs-box-shadow);
  }
  .sidebar:hover .sidebar-label,
  .sidebar:has(:focus-visible) .sidebar-label,
  .sidebar:has(.dropdown-menu.show) .sidebar-label,
  .sidebar:hover .sidebar-user::after,
  .sidebar:has(:focus-visible) .sidebar-user::after,
  .sidebar:has(.dropdown-menu.show) .sidebar-user::after {
    opacity: 1;
  }
}
@media (min-width: 992px) and (prefers-reduced-motion: no-preference) {
  .sidebar .sidebar-panel {
    transition: width 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  }
  .sidebar .sidebar-label,
  .sidebar .sidebar-user::after {
    transition: opacity 0.15s ease-in-out;
  }
}
.brand-logo {
  object-fit: contain;
}
.min-w-0 {
  min-width: 0;
}
.min-vw-0 {
  min-width: 0;
}
/* Keep forms on in-app pages a readable width. */
.app-main .settings-form,
.form-column {
  max-width: 560px;
}
/* Profile photos and their initials fallback (templates/includes/user_avatar.html). */
.user-avatar {
  object-fit: cover;
}
.user-avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  line-height: 1;
  color: var(--bs-primary-text-emphasis);
  background-color: var(--bs-primary-bg-subtle);
}
/* Settings > Profile: the photo is a button that opens the photo editor. */
.photo-button {
  position: relative;
}
.photo-button-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
}
.photo-button:hover .user-avatar,
.photo-button:focus-visible .user-avatar {
  filter: brightness(0.85);
}
.photo-cropper {
  height: min(60vh, 360px);
}
.photo-cropper img {
  display: block;
  max-width: 100%;
}
/* Show the crop as the circle people will appear in. */
.photo-cropper .cropper-view-box,
.photo-cropper .cropper-face {
  border-radius: 50%;
}
/* Bootstrap's display utilities (d-flex) would otherwise beat the hidden attribute. */
[data-photo-editor] [hidden] {
  display: none !important;
}
/* Reports: a pencil on the avatar of whoever is editing a report (templates/reports). */
.presence-editing {
  position: absolute;
  right: -4px;
  bottom: -4px;
  font-size: 0.65rem;
  color: var(--bs-warning-text-emphasis);
}
/* Reports: maps in the Location box (Leaflet). */
.report-map {
  height: 200px;
  border-radius: var(--bs-border-radius);
}
.report-map-picker {
  height: 300px;
}
