.page-center {
  background: #f4f6fa;
}

/* Sidebar: museum nav scrolls; admin + account are glued and pinned to the bottom. */
@media (min-width: 992px) {
  /* Tabler uses overflow-y:scroll on the aside; keep height fixed and scroll only nav. */
  aside.navbar-vertical.navbar-expand-lg {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  aside.navbar-vertical > .container-fluid {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
  }

  aside.navbar-vertical .navbar-collapse {
    flex: 1 1 auto;
    min-height: 0;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
  }

  aside.navbar-vertical .sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
  }

  aside.navbar-vertical .sidebar-bottom {
    flex-shrink: 0;
    margin-top: auto;
  }
}

aside.navbar-vertical .sidebar-admin-separator {
  pointer-events: none;
  padding-top: 0.25rem;
}

aside.navbar-vertical .sidebar-admin-separator .dropdown-divider {
  border-color: rgba(255, 255, 255, 0.18);
  opacity: 1;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
}

.page-footer {
  padding-top: 0.5rem;
  padding-bottom: 0.75rem;
}

.page-footer .text-secondary {
  margin: 0;
}

/* When a pager is present, copyright lives in the pager row on desktop. */
@media (min-width: 768px) {
  .page-wrapper:has(.pager-bar) .page-footer {
    display: none;
  }
}

.sidebar-account {
  padding: 0.75rem 0.5rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-account-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: var(--tblr-border-radius, 0.375rem);
  color: inherit;
  text-decoration: none;
}

.sidebar-account-toggle:hover,
.sidebar-account-toggle:focus,
.sidebar-account-toggle.show {
  color: inherit;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.sidebar-account-toggle::after {
  margin-left: auto;
  opacity: 0.7;
}

.sidebar-account-avatar {
  --tblr-avatar-bg: rgba(255, 255, 255, 0.12);
  --tblr-avatar-color: #fff;
  flex-shrink: 0;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sidebar-account-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.sidebar-account-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.sidebar-account-label {
  font-size: 0.75rem;
  opacity: 0.7;
}

.sidebar-account .dropdown-menu {
  min-width: 12rem;
}

.sidebar-account .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Page title lives in the top header to reclaim content height. */
.page-header.navbar {
  /* Tabler default navbar padding-y is 0.25rem; further tightened earlier to 0.125rem. */
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
  /* Reduce only the upper spacing by exactly 5px; leave structure unchanged. */
  margin-top: -5px;
  min-height: 0;
}

/*
 * Reduce shared page-header height by exactly 10px without changing other navbars.
 * Buttons dominate header height (Tabler btn padding-y 0.5625rem); trim 5px each side.
 */
.page-header .btn {
  padding-top: calc(0.5625rem - 10px);
  padding-bottom: calc(0.5625rem - 10px);
}

.page-header .container-fluid {
  flex-wrap: wrap;
  row-gap: 0.25rem;
  align-items: center;
}

.page-header .page-header-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
}

.page-header-title-wrap {
  min-width: 0;
  max-width: 100%;
}

.page-header .navbar-nav .text-end {
  line-height: 1.2;
}

.page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Override Tabler .page-body margin-top (spacer-4 = 1.5rem) and drop prior padding. */
.page-body {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  padding-top: 0;
}

/* Full-bleed workspace beside the sidebar (replaces capped container-xl). */
.page-content {
  width: 100%;
  max-width: none;
  padding-left: 1.5rem;  /* 24px */
  padding-right: 1.5rem;
}

@media (min-width: 1600px) {
  .page-content {
    padding-left: 2rem;   /* 32px */
    padding-right: 2rem;
  }
}

/* Solid green success toast for print / save notifications */
#app-toast-host .toast.toast-success {
  background-color: #2fb344 !important;
  color: #fff !important;
  border: 0;
}

#app-toast-host .toast.toast-success .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: 0.85;
}

#app-toast-host .toast.toast-success .btn-light {
  background-color: #fff;
  border-color: #fff;
  color: #1f7a2e;
}

.icon-inline {
  display: inline-block;
  vertical-align: -0.2em;
  margin-right: 0.35rem;
  flex-shrink: 0;
}

.printed-book-chevron {
  display: inline-block;
  width: 1rem;
  transition: transform 0.15s ease;
}

.card-header button[aria-expanded="true"] .printed-book-chevron {
  transform: rotate(90deg);
}

.navbar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-nav .nav-link .icon-inline {
  margin-right: 0;
  opacity: 0.9;
}

.nav-link .icon-inline {
  margin-right: 0.5rem;
  opacity: 0.9;
}

.btn-list .btn .icon-inline {
  margin-right: 0.35rem;
}

.card-table {
  table-layout: fixed;
  width: 100%;
}

.card-table thead th {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  vertical-align: bottom;
  line-height: 1.25;
}

.card-table .col-ordinal {
  width: 7.5rem;
}

.card-table .col-inventory {
  width: 8.5rem;
}

.card-table .col-title {
  width: auto;
  min-width: 12rem;
}

.card-table .col-extra {
  width: 14%;
  min-width: 8rem;
}

.card-table .col-meta {
  width: 12%;
  min-width: 7rem;
}

.card-table .col-photo {
  width: 4.5rem;
  white-space: nowrap;
}

.users-table .col-photo {
  width: 7.5rem;
}

.card-table .col-actions {
  width: 6.5rem;
  white-space: nowrap;
}

.card-table tbody .col-title,
.card-table tbody .col-extra,
.card-table tbody .col-meta,
.card-table tbody .col-ordinal,
.card-table tbody .col-inventory {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-table .table-action {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 0.25rem;
}

.card-table .table-action .icon-inline {
  margin-right: 0;
}

.list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.list-search-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 22rem;
  min-width: 0;
}

.list-search {
  flex: 1 1 auto;
  min-width: 12rem;
  max-width: 36rem;
}

.list-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pager-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.5rem;
  margin-top: 1rem;
}

.pager-summary {
  justify-self: start;
}

.pager-copy {
  justify-self: center;
  text-align: center;
  white-space: nowrap;
}

.pager-nav {
  justify-self: end;
}

@media (max-width: 1199.98px) {
  .card-table .col-extra {
    width: 18%;
  }
}

@media (max-width: 991.98px) {
  .card-table .col-ordinal {
    width: 6.5rem;
  }

  .card-table .col-inventory {
    width: 7.5rem;
  }

  .card-table .col-extra {
    width: 22%;
  }
}

@media (max-width: 767.98px) {
  .page-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .list-toolbar,
  .list-filters {
    align-items: stretch;
    width: 100%;
  }

  .list-search-group {
    flex-wrap: wrap;
  }

  .list-search,
  .list-filters .form-select {
    width: 100%;
    max-width: none;
  }

  .pager-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .pager-copy {
    display: none;
  }

  .pager-nav {
    margin-left: auto;
  }

  .pager-bar .pagination {
    flex-wrap: wrap;
  }

  .card-table .col-ordinal,
  .card-table .col-inventory {
    width: 5.5rem;
  }
}
