/* CRM overrides on top of the Vuexy core */

.menu .app-brand {
  height: 64px;
}

.app-brand-logo .avatar-initial {
  width: 34px;
  height: 34px;
}

.app-brand-text {
  font-size: 1.25rem;
}

.layout-navbar-fixed .layout-wrapper:not(.layout-horizontal):not(.layout-without-menu) .layout-page {
  padding-top: 72px !important;
}

.content-wrapper .navbar {
  z-index: auto;
}

/* Table cell that may wrap inside a nowrap table */
.cell-wrap {
  min-width: 12rem;
  white-space: normal;
}

.text-pre-line {
  white-space: pre-line;
}

/* Whole card is a link (x-ui.link-card) */
.card-link {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.card-link:hover {
  box-shadow: var(--bs-box-shadow-lg);
  transform: translateY(-2px);
}

/* Image thumbnails (x-ui.gallery, x-ui.images-input) */
.crm-thumb {
  display: block;
  width: 140px;
  height: 100px;
  border-radius: var(--bs-border-radius);
  border: 1px solid var(--bs-border-color);
  object-fit: cover;
  background: var(--bs-gray-100);
}

/* Reorderable thumbnails (x-ui.images-input): the first one is the main image */
.crm-sortable-item {
  cursor: grab;
}

.crm-sortable-item.is-dragging {
  opacity: 0.35;
}

.crm-main-badge {
  position: absolute;
  top: 0.375rem;
  left: 0.375rem;
  display: none;
}

[data-crm-sortable] > :first-child .crm-main-badge {
  display: inline-block;
}

/* Previews of the links typed or picked for a gallery (x-ui.images-input) */
.crm-link-preview {
  position: relative;
}

.crm-link-preview .crm-thumb {
  width: 96px;
  height: 72px;
}

.crm-link-broken {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 72px;
  padding: 0.25rem;
  border: 1px dashed var(--bs-danger);
  border-radius: var(--bs-border-radius);
  color: var(--bs-danger);
  font-size: 0.75rem;
  text-align: center;
}

.crm-link-preview .btn {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  width: 1.375rem;
  height: 1.375rem;
  padding: 0;
  border-radius: 50%;
  line-height: 1;
}

/* Image server browser tiles (x-ui.media-library) */
.crm-media-tile {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.375rem;
  border: 2px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background: var(--bs-paper-bg, #fff);
  cursor: pointer;
}

.crm-media-tile img {
  width: 100%;
  height: 110px;
  border-radius: calc(var(--bs-border-radius) - 2px);
  object-fit: cover;
}

.crm-media-tile.is-selected {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.16);
}

.crm-media-name {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
}

.crm-lightbox-image {
  max-width: 100%;
  max-height: 78vh;
  border-radius: var(--bs-border-radius);
}

/* Repeater rows (x-ui.repeater) */
[data-crm-repeater-item] + [data-crm-repeater-item] {
  margin-top: 0.75rem;
}

/* Rich text shown on detail pages */
.crm-richtext > :last-child {
  margin-bottom: 0;
}

.crm-richtext table {
  width: 100%;
  margin-bottom: 1rem;
}

.crm-richtext td,
.crm-richtext th {
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--bs-border-color);
}

/* Summernote inside Vuexy forms */
.note-editor.note-frame {
  border-color: var(--bs-border-color);
  border-radius: var(--bs-border-radius);
}

.note-editor .note-toolbar {
  background: var(--bs-gray-50, #f8f8f9);
  border-bottom-color: var(--bs-border-color);
}

/* Badges next to a page title keep their normal size */
h4 > .badge {
  font-size: 0.8125rem;
}

/* Photo tiles (x-ui.photo-card) */
.crm-photo-card .card-img-top {
  height: 190px;
  object-fit: cover;
  background: var(--bs-gray-100);
}
