:root {
  --bs-font-sans-serif: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);
  --bs-body-bg: #f7f7f7;
  --bs-body-color: #202124;
  --bs-primary: #1f4f99;
  --bs-primary-rgb: 31, 79, 153;
  --bs-secondary: #5a6b87;
  --bs-secondary-rgb: 90, 107, 135;
  --bs-border-color: #d3dae6;
  --bs-link-color: #1f4f99;
  --bs-link-hover-color: #163a72;
  --ivt-section-gap: 1.5rem;
  --ivt-card-radius: 0.5rem;
  --ivt-page-max-width: 960px;
}

body {
  min-height: 100vh;
}

.ivt-layout {
  min-height: 100vh;
}

.ivt-sidebar {
  width: 240px;
  background-color: var(--bs-primary);
  color: #fff;
  position: sticky;
  top: 0;
  align-self: flex-start;
  min-height: 100vh;
  flex-shrink: 0;
}

.ivt-sidebar-meta {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
  text-align: center;
  line-height: 1.4;
}

.ivt-app-meta {
  display: block;
}

.ivt-version-trigger {
  --bs-btn-color: rgba(255, 255, 255, 0.55);
  --bs-btn-hover-color: #fff;
  --bs-link-color: rgba(255, 255, 255, 0.55);
  --bs-link-hover-color: #fff;
  font-size: inherit;
  line-height: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 0.15em;
  vertical-align: baseline;
}

.ivt-version-trigger:hover,
.ivt-version-trigger:focus-visible {
  text-decoration-color: currentColor;
}

.login-footer .ivt-version-trigger {
  --bs-btn-color: rgba(255, 255, 255, 0.55);
  --bs-btn-hover-color: #fff;
}

.ivt-changelog-body {
  max-height: min(70vh, 32rem);
}

.ivt-changelog-release + .ivt-changelog-release {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--bs-border-color);
}

.ivt-changelog-release--current .ivt-changelog-version {
  color: var(--bs-primary);
}

.ivt-changelog-list {
  padding-left: 1.25rem;
}

.ivt-changelog-list li + li {
  margin-top: 0.35rem;
}

.login-footer .ivt-app-meta {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
}

.ivt-sidebar .navbar-brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.ivt-sidebar .nav-link .nf {
  display: inline-block;
  width: 1.25rem;
  margin-right: 0.35rem;
  text-align: center;
  vertical-align: -0.1em;
  opacity: 0.95;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.ivt-sidebar .nav-link {
  color: rgba(255, 255, 255, 0.92);
  border-radius: 0.5rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.15rem;
  transition:
    color 0.2s ease,
    background-color 0.25s ease,
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s ease;
}

.ivt-sidebar .nav-link:hover .nf,
.ivt-sidebar .nav-link:focus .nf {
  transform: scale(1.12);
}

.ivt-sidebar .nav-link:hover,
.ivt-sidebar .nav-link:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(4px);
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.55);
}

.ivt-sidebar .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 3px 0 0 #fff;
}

.ivt-sidebar .navbar-brand:hover {
  opacity: 0.92;
  transform: translateX(2px);
}

.ivt-sidebar .navbar-toggler {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.ivt-sidebar .navbar-toggler:not(.collapsed) {
  transform: rotate(90deg);
}

.ivt-sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.875rem;
  line-height: 1.35;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.ivt-sidebar-user-icon {
  flex-shrink: 0;
  font-size: 1.35rem;
  opacity: 0.95;
  line-height: 1;
}

.ivt-sidebar-user-name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  word-break: break-word;
}

.ivt-sidebar-logout {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.375rem;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    transform 0.2s ease;
}

.ivt-sidebar-logout .nf {
  font-size: 1.1rem;
  line-height: 1;
}

.ivt-sidebar-logout:hover,
.ivt-sidebar-logout:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.05);
}

.ivt-main {
  min-width: 0;
  --ivt-main-pad-x: 1rem;
  --ivt-main-pad-y: 1rem;
}

@media (min-width: 768px) {
  .ivt-main {
    --ivt-main-pad-x: 1.5rem;
    --ivt-main-pad-y: 1.5rem;
  }
}

.ivt-page-toolbar {
  width: calc(100% + 2 * var(--ivt-main-pad-x));
  max-width: none;
  margin-left: calc(-1 * var(--ivt-main-pad-x));
  margin-right: calc(-1 * var(--ivt-main-pad-x));
  padding: 0.5rem var(--ivt-main-pad-x) 0.75rem;
  background: var(--bs-body-bg);
  border: 0;
  border-bottom: 1px solid var(--bs-border-color-translucent, var(--bs-border-color));
  border-radius: 0;
  box-shadow: 0 0.5rem 0.75rem -0.35rem rgba(0, 0, 0, 0.12);
  margin-top: -1.75rem;
}

.ivt-page-toolbar-inner {
  width: 100%;
}

.ivt-breadcrumbs {
  width: 100%;
}

.ivt-breadcrumbs .breadcrumb {
  --bs-breadcrumb-margin-bottom: 0;
  font-size: 0.8125rem;
}

.ivt-breadcrumbs .breadcrumb-item + .breadcrumb-item::before {
  color: var(--bs-secondary-color);
}

.ivt-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0;
  width: 100%;
}

.ivt-page-header h1 {
  flex: 1 1 auto;
  min-width: min(100%, 12rem);
  margin-bottom: 0;
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  line-height: 1.25;
  font-weight: 600;
}

.ivt-page-header .btn {
  flex-shrink: 0;
  max-width: 100%;
}

.ivt-page-header-text {
  flex: 1 1 auto;
  min-width: min(100%, 12rem);
}

.ivt-page-subtitle {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

.ivt-page-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ivt-page-header-actions:not(:has(> *)) {
  display: none;
}

.ivt-section {
  margin-bottom: var(--ivt-section-gap);
}

.ivt-section--narrow {
  max-width: var(--ivt-page-max-width);
}

.ivt-section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.85rem;
}

.ivt-section-heading h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--bs-secondary);
}

.ivt-section-heading-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.ivt-back-link {
  margin-top: 1.25rem;
  margin-bottom: 0;
}

.ivt-back-link .nf {
  vertical-align: -0.1em;
}

.ivt-list-search {
  max-width: 28rem;
  margin-bottom: 1rem;
}

.ivt-form-card {
  max-width: var(--ivt-page-max-width);
  border-color: var(--bs-border-color);
  border-radius: var(--ivt-card-radius);
}

.ivt-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--bs-border-color);
}

.ivt-empty-state {
  color: var(--bs-secondary);
  font-style: italic;
  text-align: center;
  padding: 1.25rem 0.75rem !important;
  white-space: normal;
}

.ivt-alert-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 575.98px) {
  .ivt-page-header:has(.ivt-action-bar .btn) .ivt-page-header-text {
    flex-basis: 100%;
  }

  .ivt-page-header-actions {
    width: 100%;
  }

  .ivt-page-header-actions .btn:not(.dropdown-toggle) {
    flex: 1 1 auto;
  }

  .ivt-page-header-actions .btn-group {
    width: 100%;
  }

  .ivt-page-header-actions .btn-group .btn {
    flex: 1 1 0;
  }

  .ivt-form-actions .btn {
    width: 100%;
  }
}

@media (max-width: 991.98px) {
  .ivt-layout {
    flex-direction: column;
  }

  .ivt-sidebar {
    width: 100%;
    min-height: auto;
    position: relative;
  }

  .ivt-sidebar .navbar-collapse {
    margin-top: 0.5rem;
  }
}

/* Legacy form-grid mapped to Bootstrap form styling */
.form-grid {
  max-width: 860px;
  width: 100%;
}

.form-grid > label,
.form-grid label.form-label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--bs-body-color);
}

.form-grid > input:not([type='hidden']):not([type='checkbox']):not([type='color']),
.form-grid > select,
.form-grid > textarea,
.form-grid .form-control,
.form-grid .form-select {
  display: block;
  width: 100%;
  margin-bottom: 0.75rem;
}

.form-grid > button[type='submit'],
.form-grid > .btn,
.form-grid > a .btn {
  margin-top: 0.25rem;
}

.form-grid > label > button {
  margin-left: 0.35rem;
}

.form-grid > select.ivt-searchable-select.tomselected {
  margin-bottom: 0;
}

.form-grid .ts-wrapper {
  width: 100%;
  margin-bottom: 0.75rem;
}

.form-grid .ts-wrapper + .text-muted.small {
  margin-top: -0.5rem;
}

.ivt-data-table {
  min-width: 640px;
  white-space: nowrap;
}

.ivt-data-table th {
  background-color: #e8eff8;
}

.ivt-sort-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 0.25rem; }
.ivt-sort-link:hover { color: var(--bs-link-color); }
.ivt-sort-active { font-weight: 600; }
.ivt-sort-indicator { font-size: 0.75rem; opacity: 0.85; }

.ivt-action-buttons {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.25rem;
}

.ivt-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  line-height: 1;
}

.ivt-action-btn .nf {
  font-size: 1rem;
  line-height: 1;
}

.ivt-data-table td:has(.ivt-action-buttons) {
  white-space: nowrap;
  width: 1%;
}

.ivt-summary-table {
  min-width: 0;
  max-width: 28rem;
  width: 100%;
  white-space: normal;
}

.ivt-summary-table td:last-child {
  text-align: right;
}

.ivt-home-tiles {
  max-width: 56rem;
}

.ivt-home-tile {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
  padding: 1.1rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(31, 79, 153, 0.08);
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.ivt-home-tile:hover,
.ivt-home-tile:focus {
  color: inherit;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(31, 79, 153, 0.1);
  border-color: rgba(31, 79, 153, 0.18);
}

.ivt-home-tile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.65rem;
  font-size: 1.35rem;
  background: rgba(255, 255, 255, 0.65);
  color: var(--bs-primary);
}

.ivt-home-tile-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ivt-home-tile-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bs-secondary);
  line-height: 1.3;
}

.ivt-home-tile-value {
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 700;
  color: var(--bs-primary);
}

.ivt-home-tile--inventory { background: #e8eff8; }
.ivt-home-tile--broken { background: #fdecea; }
.ivt-home-tile--discarded { background: #f1f3f5; }
.ivt-home-tile--liquidated { background: #eceff1; }
.ivt-home-tile--holders { background: #eef4fc; }
.ivt-home-tile--audits { background: #e8f5ec; }
.ivt-home-tile--organizations { background: #fff3e6; }
.ivt-home-tile--suppliers { background: #fff3e6; }
.ivt-home-tile--manufacturers { background: #f3ecfa; }
.ivt-home-tile--service { background: #e6f6f6; }
.ivt-home-tile--locations { background: #fceef3; }
.ivt-home-tile--cost-centers { background: #f2f5e8; }
.ivt-home-tile--tags { background: #e9f0f8; }

.audit-stats-bar {
  z-index: 1020;
}

tr.row-extra td {
  background: #fff7ed;
}

tr.row-location-extra td {
  background: #fef9c3;
}

.audit-location-stat-card {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.audit-location-stat-card strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.2;
}

.audit-location-stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--bs-secondary);
  margin-bottom: 0.25rem;
}

.audit-stat-switch {
  text-align: center;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.audit-stat-switch:hover {
  border-color: var(--bs-primary) !important;
}

.audit-stat-switch.active {
  border-color: var(--bs-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.2);
}

body.modal-open .audit-stats-bar {
  z-index: 1010;
}

/* Audit check — mobile fullscreen scanning mode */
body.ivt-audit-check-fullscreen {
  overflow: hidden;
}

body.ivt-audit-check-fullscreen .ivt-layout > .ivt-sidebar {
  display: none !important;
}

body.ivt-audit-check-fullscreen .ivt-main {
  padding: 0 !important;
  overflow: hidden;
}

body.ivt-audit-check-fullscreen .ivt-alert-stack,
body.ivt-audit-check-fullscreen .ivt-audit-check-hide-fs {
  display: none !important;
}

body.ivt-audit-check-fullscreen #ivt-audit-check-shell,
#ivt-audit-check-shell.ivt-audit-check-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
  height: 100dvh;
  max-height: 100dvh;
  background: var(--bs-body-bg);
  overflow: hidden;
}

html:fullscreen,
html:-webkit-full-screen {
  width: 100%;
  height: 100%;
  background: var(--bs-body-bg);
}

body.ivt-audit-check-fullscreen .ivt-audit-check-fs-top {
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--bs-border-color);
  background: var(--bs-primary);
  color: #fff;
}

body.ivt-audit-check-fullscreen .ivt-audit-check-fs-top-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

body.ivt-audit-check-fullscreen .ivt-audit-check-fs-top .btn {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

body.ivt-audit-check-fullscreen .ivt-audit-check-fs-top .ivt-audit-sound-btn {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

body.ivt-audit-check-fullscreen .ivt-audit-check-fs-top .ivt-audit-sound-btn[aria-pressed='true'] {
  background: #fff;
  border-color: #fff;
  color: var(--bs-primary);
}

body.ivt-audit-check-fullscreen .ivt-audit-check-toolbar .ivt-audit-sounds-slot {
  display: none;
}

body.ivt-audit-check-fullscreen .ivt-audit-check-fs-top-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ivt-audit-check-fullscreen .audit-stats-bar {
  position: static;
  top: auto;
  flex-shrink: 0;
  margin: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
  border-left: 0;
  border-right: 0;
}

body.ivt-audit-check-fullscreen .ivt-audit-check-entries {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.ivt-audit-check-fullscreen .ivt-audit-check-entries .ivt-audit-check-hide-fs {
  display: none !important;
}

body.ivt-audit-check-fullscreen #audit-fullscreen-toggle {
  display: none;
}

body.ivt-audit-check-fullscreen #audit-check-form .form-control {
  font-size: 1.05rem;
}

body.ivt-audit-check-fullscreen #audit-check-form .btn-primary {
  min-height: 2.75rem;
}

.ivt-audit-check-fs-top {
  display: none;
}

.ivt-audit-sound-btn {
  padding: 0.25rem 0.45rem;
  line-height: 1;
}

.ivt-audit-sound-btn .nf {
  font-size: 1.15rem;
  line-height: 1;
}

.ivt-activity-log-modal {
  z-index: 1055;
}

.ivt-activity-log-dialog {
  width: calc(100% - 2rem);
  max-width: 1140px;
  max-height: calc(100vh - 2rem);
  margin: 1rem auto;
}

.ivt-activity-log-modal .modal-content {
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
}

.ivt-activity-log-modal .modal-header,
.ivt-activity-log-modal .modal-footer {
  flex-shrink: 0;
}

.ivt-activity-log-modal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.ivt-activity-log-table-wrap {
  max-height: calc(100vh - 12rem);
  overflow: auto;
}

.ivt-activity-log-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bs-body-bg);
  box-shadow: inset 0 -1px 0 var(--bs-border-color);
}

.activity-log-detail-cell {
  white-space: normal;
  min-width: 10rem;
  max-width: 28rem;
  vertical-align: top;
}

.activity-log-changes {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: var(--bs-secondary);
}

.activity-log-changes li {
  white-space: normal;
  margin-bottom: 0.2rem;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    145deg,
    var(--ivt-login-gradient-start, #163a72) 0%,
    var(--ivt-login-gradient-mid, #1f4f99) 45%,
    var(--ivt-login-gradient-end, #2a6cb8) 100%
  );
}

.login-page-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(0, 0, 0, 0.15) 0%, transparent 50%);
  pointer-events: none;
  animation: ivt-backdrop-drift 8s ease-in-out infinite;
}

.login-page-main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
}

.login-card {
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-card-header {
  padding: 2rem 1.5rem 0.5rem;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.login-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  background: var(--bs-primary);
  color: #fff;
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.login-brand-icon::before {
  font-family: 'NerdFontsSymbols Nerd Font', monospace;
}

.login-brand-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--bs-primary);
  margin-bottom: 0.25rem;
}

.login-brand-subtitle {
  font-size: 0.95rem;
}

.login-form .form-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #374151;
}

.login-input-icon {
  background: #f1f5f9;
  border-color: var(--bs-border-color);
  color: var(--bs-primary);
  min-width: 3rem;
  justify-content: center;
}

.login-input-icon .nf::before {
  font-size: 1.1rem;
}

.login-form .form-control-lg {
  border-color: var(--bs-border-color);
}

.login-form .form-control-lg:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(31, 79, 153, 0.15);
}

.login-submit {
  font-weight: 600;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  box-shadow: 0 4px 14px rgba(31, 79, 153, 0.35);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.login-submit:hover {
  box-shadow: 0 6px 18px rgba(31, 79, 153, 0.45);
  transform: translateY(-1px);
}

.login-submit:active {
  transform: translateY(0);
}

.login-footer {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

@media (max-width: 480px) {
  .login-page-main {
    padding: 1rem;
  }

  .login-card-header {
    padding-top: 1.5rem;
  }
}

/* --- Motion: login, navbar, modals --- */

@keyframes ivt-fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ivt-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ivt-slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes ivt-scale-in {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes ivt-modal-in {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes ivt-backdrop-drift {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.88; }
}

@keyframes ivt-brand-pop {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  70% {
    transform: scale(1.08);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes ivt-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Login page */
.login-card {
  animation: ivt-scale-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-brand-icon {
  animation: ivt-brand-pop 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.login-brand-title,
.login-brand-subtitle {
  animation: ivt-fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-brand-title {
  animation-delay: 0.18s;
}

.login-brand-subtitle {
  animation-delay: 0.28s;
}

.login-form > * {
  animation: ivt-fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-form > *:nth-child(1) { animation-delay: 0.32s; }
.login-form > *:nth-child(2) { animation-delay: 0.42s; }
.login-form > *:nth-child(3) { animation-delay: 0.52s; }

.login-footer {
  animation: ivt-fade-in 0.5s ease 0.65s both;
}

.login-alert-animate {
  animation: ivt-shake 0.45s ease, ivt-fade-up 0.4s ease both;
}

.login-form .form-control-lg,
.login-form .input-group-text {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* App layout: navbar entrance once after login; main content every page */
.ivt-nav-enter .ivt-sidebar {
  animation: ivt-slide-in-left 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ivt-nav-enter .ivt-nav .nav-item {
  animation: ivt-fade-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ivt-nav-enter .ivt-nav .nav-item:nth-child(1) { animation-delay: 0.05s; }
.ivt-nav-enter .ivt-nav .nav-item:nth-child(2) { animation-delay: 0.08s; }
.ivt-nav-enter .ivt-nav .nav-item:nth-child(3) { animation-delay: 0.11s; }
.ivt-nav-enter .ivt-nav .nav-item:nth-child(4) { animation-delay: 0.14s; }
.ivt-nav-enter .ivt-nav .nav-item:nth-child(5) { animation-delay: 0.17s; }
.ivt-nav-enter .ivt-nav .nav-item:nth-child(6) { animation-delay: 0.2s; }
.ivt-nav-enter .ivt-nav .nav-item:nth-child(7) { animation-delay: 0.23s; }
.ivt-nav-enter .ivt-nav .nav-item:nth-child(8) { animation-delay: 0.26s; }
.ivt-nav-enter .ivt-nav .nav-item:nth-child(9) { animation-delay: 0.29s; }
.ivt-nav-enter .ivt-nav .nav-item:nth-child(10) { animation-delay: 0.32s; }
.ivt-nav-enter .ivt-nav .nav-item:nth-child(11) { animation-delay: 0.35s; }
.ivt-nav-enter .ivt-nav .nav-item:nth-child(12) { animation-delay: 0.38s; }
.ivt-nav-enter .ivt-nav .nav-item:nth-child(13) { animation-delay: 0.41s; }
.ivt-nav-enter .ivt-nav .nav-item:nth-child(14) { animation-delay: 0.44s; }

.ivt-main-animate {
  animation: ivt-fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

@media (max-width: 991.98px) {
  .ivt-sidebar .navbar-collapse.collapsing {
    transition: height 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  }
}

/* Modals */
.ivt-modal.fade .modal-dialog {
  transform: scale(0.94) translateY(12px);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.ivt-modal.show .modal-dialog,
.ivt-modal.fade.show .modal-dialog {
  transform: scale(1) translateY(0);
}

.ivt-modal .modal-content {
  overflow: hidden;
  border: none;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.ivt-modal.show .modal-header,
.ivt-modal.show .modal-body,
.ivt-modal.show .modal-footer {
  animation: ivt-fade-up 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ivt-modal.show .modal-body {
  animation-delay: 0.05s;
}

.ivt-modal.show .modal-footer {
  animation-delay: 0.1s;
}

.ivt-modal .btn {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ivt-modal .btn:active {
  transform: scale(0.97);
}

#confirm-ok .nf {
  margin-right: 0.35rem;
  vertical-align: -0.1em;
}

.ivt-bulk-bar .card-body {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.ivt-bulk-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-8px);
  margin-bottom: 0;
  pointer-events: none;
  transition:
    grid-template-rows 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease,
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    margin-bottom 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.ivt-bulk-panel.is-visible {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateY(0);
  margin-bottom: 0.65rem;
  pointer-events: auto;
}

.ivt-bulk-panel-inner {
  overflow: hidden;
  min-height: 0;
}

.ivt-bulk-panel.is-visible .ivt-bulk-panel-inner > form {
  animation: ivt-fade-up 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ivt-export-actions {
  margin-left: auto;
}

.ivt-meta-list {
  color: var(--bs-secondary);
  font-size: 0.95rem;
}

.ivt-meta-list p:last-child {
  margin-bottom: 0;
}

.ivt-settings-form .ivt-color-input {
  width: 3rem;
  height: 2.5rem;
  padding: 0.15rem;
}

.ivt-settings-logo-preview {
  display: inline-block;
}

.ivt-settings-logo-image {
  max-height: 4rem;
  max-width: 100%;
  object-fit: contain;
}

.ivt-system-dl dt {
  color: var(--bs-secondary-color);
  font-weight: 500;
}

.ivt-system-dl dd {
  margin-bottom: 0.5rem;
}

.ivt-system-path {
  word-break: break-all;
}

.ivt-system-progress {
  height: 0.85rem;
}

.ivt-bulk-action-select {
  min-width: 11rem;
  max-width: 100%;
}

.ivt-bulk-tags {
  min-width: 10rem;
  max-width: 100%;
}

.ivt-col-select {
  width: 2.5rem;
  text-align: center;
  vertical-align: middle;
}

.ivt-label-template-table input[type="number"] {
  min-width: 4.5rem;
}

.ivt-label-template-table td:nth-child(5) input[type="number"] {
  min-width: 3.5rem;
  max-width: 4.5rem;
}

.ivt-label-template-table .ivt-label-text-style {
  flex-wrap: nowrap;
}

.ivt-label-template-table .ivt-label-text-style .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
}

.ivt-label-template-table .ivt-label-text-style .btn-check:checked + .btn {
  color: var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.12);
  border-color: var(--bs-primary);
  box-shadow: none;
}

.ivt-label-template-table .ivt-label-text-style .btn-check:focus-visible + .btn {
  z-index: 1;
}

.ivt-label-template-table .form-label-sm {
  font-size: 0.7rem;
  color: var(--bs-secondary-color);
}

.ivt-label-preview-wrap {
  position: sticky;
  top: 1rem;
}

.ivt-label-preview {
  position: relative;
  border: 1px dashed var(--bs-border-color);
  background: #fff;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03);
}

.ivt-label-preview-logo,
.ivt-label-preview-name,
.ivt-label-preview-inventory-number,
.ivt-label-preview-inventory-barcode,
.ivt-label-preview-barcode,
.ivt-label-preview-serial,
.ivt-label-preview-custom-text,
.ivt-label-preview-custom-image {
  position: absolute;
  transform-origin: top left;
}

.ivt-label-preview-logo {
  object-fit: contain;
}

.ivt-label-preview-logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-light);
  color: var(--bs-secondary-color);
  font-size: 0.65rem;
}

.ivt-label-preview-name {
  line-height: 1.1;
  overflow: hidden;
  box-sizing: border-box;
}

.ivt-label-preview-barcode {
  min-width: 10px;
  background: repeating-linear-gradient(
    90deg,
    #111 0,
    #111 2px,
    #fff 2px,
    #fff 4px
  );
  border: 1px solid #ccc;
}

.ivt-label-preview-inventory-number {
  font-family: monospace;
  line-height: 1;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ivt-label-preview-inventory-barcode {
  min-width: 10px;
  background: repeating-linear-gradient(
    90deg,
    #333 0,
    #333 1px,
    #fff 1px,
    #fff 3px
  );
  border: 1px solid #bbb;
}

.ivt-label-preview-serial {
  font-family: monospace;
  line-height: 1;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ivt-label-preview-custom-text {
  line-height: 1.1;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ivt-label-preview-custom-image {
  object-fit: contain;
}

.ivt-label-preview-custom-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-light);
  color: var(--bs-secondary-color);
  font-size: 0.65rem;
}

.ivt-label-custom-image-upload-preview {
  max-width: 120px;
  max-height: 80px;
  object-fit: contain;
  border: 1px solid var(--bs-border-color);
  background: #fff;
  padding: 0.25rem;
}

.ivt-label-preview--outlines .ivt-label-preview-logo,
.ivt-label-preview--outlines .ivt-label-preview-name,
.ivt-label-preview--outlines .ivt-label-preview-inventory-number,
.ivt-label-preview--outlines .ivt-label-preview-inventory-barcode,
.ivt-label-preview--outlines .ivt-label-preview-barcode,
.ivt-label-preview--outlines .ivt-label-preview-serial,
.ivt-label-preview--outlines .ivt-label-preview-custom-text,
.ivt-label-preview--outlines .ivt-label-preview-custom-image {
  outline-offset: -1px;
}

.ivt-label-preview--outlines .ivt-label-preview-logo {
  outline: 1px dashed rgba(25, 135, 84, 0.9);
}

.ivt-label-preview--outlines .ivt-label-preview-name {
  outline: 1px dashed rgba(13, 110, 253, 0.9);
}

.ivt-label-preview--outlines .ivt-label-preview-inventory-number {
  outline: 1px dashed rgba(255, 193, 7, 0.95);
}

.ivt-label-preview--outlines .ivt-label-preview-inventory-barcode {
  outline: 1px dashed rgba(253, 126, 20, 0.95);
}

.ivt-label-preview--outlines .ivt-label-preview-barcode {
  outline: 1px dashed rgba(111, 66, 193, 0.9);
}

.ivt-label-preview--outlines .ivt-label-preview-serial {
  outline: 1px dashed rgba(220, 53, 69, 0.9);
}

.ivt-label-preview--outlines .ivt-label-preview-custom-text {
  outline: 1px dashed rgba(32, 201, 151, 0.95);
}

.ivt-label-preview--outlines .ivt-label-preview-custom-image {
  outline: 1px dashed rgba(13, 202, 240, 0.95);
}

@media (max-width: 575.98px) {
  .ivt-bulk-panel.is-visible form,
  .ivt-export-actions {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .login-page-backdrop {
    animation: none;
  }

  .ivt-sidebar .nav-link:hover,
  .ivt-sidebar .nav-link:focus {
    transform: none;
  }

  .ivt-sidebar-logout:hover,
  .ivt-sidebar-logout:focus {
    transform: none;
  }

  .login-submit:hover {
    transform: none;
  }
}
