/*
  SourceTrack overrides for the Bootstrap admin theme.
  Keep this file for non-destructive tweaks (do not edit vendor theme CSS).
*/

/* Remove unwanted top spacing for fixed header/sidebar */
#main-wrapper[data-layout="vertical"][data-sidebar-position="fixed"] .left-sidebar,
.left-sidebar {
  top: 0 !important;
}

#main-wrapper[data-layout="vertical"][data-header-position="fixed"] .app-header,
.app-header {
  top: 0 !important;
}

/*
  Sticky footer (always visible at bottom on short pages)
  - No overlap: footer stays in normal document flow
  - Natural scroll: footer moves down when content overflows
*/
.body-wrapper-inner {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 70px);
}

.body-wrapper-inner > .container-fluid {
  flex: 1 0 auto;
}

.body-wrapper-inner > .container {
  flex: 1 0 auto;
}

/* Site footer: minimal polish, aligned with main container */
.body-wrapper-inner > footer.app-footer {
  margin-top: auto;
  flex-shrink: 0;
}

.app-footer {
  padding-block: 1.125rem 1.25rem;
  padding-inline: 0;
  background-color: var(--bs-secondary-bg);
  border-top: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.08));
  box-shadow: 0 -1px 0 rgba(15, 23, 42, 0.04);
}

.app-footer-inner {
  text-align: center;
}

@media (min-width: 768px) {
  .app-footer-inner {
    text-align: right;
  }
}

.app-footer-text {
  font-size: 0.8125rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--bs-secondary-color);
  max-width: 100%;
}

@media (max-width: 767.98px) {
  .app-footer {
    padding-block: 1rem 1.125rem;
  }

  .app-footer-text {
    font-size: 0.8125rem;
    padding-inline: 0.25rem;
  }
}

/* Mobile bottom navigation (phones only; matches d-md-none) */
@media (max-width: 767.98px) {
  .has-mobile-bottom-nav {
    padding-bottom: calc(3.35rem + env(safe-area-inset-bottom, 0px));
  }
}

.mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background-color: var(--bs-body-bg);
  border-top: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.08));
  box-shadow: 0 -0.25rem 0.75rem rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

.mobile-bottom-nav__inner {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 0;
  max-width: 100%;
  min-height: 3rem;
}

.mobile-bottom-nav__btn {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.35rem 0.25rem 0.45rem;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--bs-secondary-color);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-bottom-nav__btn:hover {
  color: var(--bs-body-color);
  background-color: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.06);
}

.mobile-bottom-nav__btn:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: -2px;
  z-index: 1;
}

.mobile-bottom-nav__btn.is-active {
  color: var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.1);
}

.mobile-bottom-nav__btn.is-active .mobile-bottom-nav__label {
  font-weight: 600;
}

.mobile-bottom-nav__btn--disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.mobile-bottom-nav__btn--action {
  color: var(--bs-secondary-color);
}

.mobile-bottom-nav__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.mobile-bottom-nav__icon iconify-icon {
  font-size: 1.35rem;
}

.mobile-bottom-nav__label {
  font-size: 0.65rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: none;
}

/* Mobile: subtle header elevation (matches Bootstrap card / theme shadows) */
@media (max-width: 1199.98px) {
  .app-header {
    box-shadow: 0 0.125rem 0.375rem rgba(15, 23, 42, 0.06), 0 0.0625rem 0.125rem rgba(15, 23, 42, 0.04);
  }

  .mobile-header-nav {
    position: relative;
  }

  .mobile-header-logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
  }

  .mobile-header-logo img {
    /* height: 28px; */
    height: 100%;
    width: auto;
    display: block;
  }
}

/* Mobile drawer: logo centered, close control fixed to top-right (not vertically centered with logo) */
@media (max-width: 1199.98px) {
  .left-sidebar .brand-logo {
    position: relative;
    min-height: 4.5rem;
    padding: 0.75rem 3rem 0.75rem 1rem;
    align-items: center;
    justify-content: center;
  }

  .left-sidebar .brand-logo .logo-img {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    padding-inline: 0.25rem;
  }

  .left-sidebar .brand-logo .brand-logo-img {
    max-height: 2.75rem;
    width: auto;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
    margin-inline: auto;
    display: block;
  }

  .left-sidebar .brand-logo .close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 5;
    color: var(--bs-secondary-color);
    border-radius: 0.375rem;
  }

  .left-sidebar .brand-logo .close-btn:hover,
  .left-sidebar .brand-logo .close-btn:focus-visible {
    color: var(--bs-body-color);
    background-color: rgba(var(--bs-secondary-rgb), 0.12) !important;
    outline: none;
  }
}

@media (min-width: 1200px) {
  .left-sidebar .brand-logo .close-btn {
    display: none !important;
  }
}

/* Specimens list / grid view */
.specimen-view-toggle .btn.active {
  background-color: var(--bs-secondary-bg);
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
}

.specimen-card {
  border-radius: var(--bs-border-radius-lg);
  overflow: hidden;
}

/* Image: full photo visible (no crop), fixed frame, top corners only */
.specimen-card-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 190px;
  padding: 0.5rem;
  overflow: hidden;
  border-bottom: 1px solid var(--bs-border-color-translucent, var(--bs-border-color));
  border-top-left-radius: var(--bs-border-radius-lg);
  border-top-right-radius: var(--bs-border-radius-lg);
}

.specimen-card-thumb-link {
  cursor: zoom-in;
  min-height: 0;
  border-radius: inherit;
}

.specimen-card-thumb-link:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

.specimen-card-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
}

.specimen-card-thumb-empty {
  min-height: 190px;
  background: linear-gradient(145deg, var(--bs-secondary-bg), var(--bs-body-bg));
}

.specimen-card-thumb-icon {
  font-size: 3rem;
  color: var(--bs-secondary-color);
  opacity: 0.45;
}

.specimen-card-body {
  min-height: 0;
  padding-top: 0.875rem;
}

.specimen-card-fields {
  min-width: 0;
}

/* Label : value rows */
.specimen-kv {
  font-size: 0.875rem;
  line-height: 1.45;
  word-break: break-word;
}

.specimen-kv-label {
  font-weight: 600;
  color: var(--bs-secondary-color);
}

.specimen-kv-sep {
  font-weight: 600;
  color: var(--bs-secondary-color);
  margin-right: 0.25rem;
}

.specimen-kv-value {
  font-weight: 400;
  color: var(--bs-body-color);
}

.specimen-kv-value--locality .specimen-locality {
  display: inline;
}

.specimen-locality-expanded {
  display: block;
  margin-top: 0.25rem;
  word-break: break-word;
}

.js-specimen-locality-toggle {
  font-size: 0.8125rem;
  margin-left: 0.15rem;
  vertical-align: baseline;
  text-decoration: none;
}

.js-specimen-locality-toggle:hover {
  text-decoration: underline;
}

.specimen-card-actions {
  border-top: 1px solid var(--bs-border-color-translucent, var(--bs-border-color));
}

.specimen-grid-row {
  align-items: stretch;
}

