/* =======
   Root Variables & Theme
   ======= */
:root {
  --bs-link-color: #004d73;
  --bs-link-color-rgb: 0, 77, 115;
  --bs-link-hover-color: #006699;
  --bs-link-hover-color-rgb: 0, 102, 153;
  --bs-focus-ring-color: rgba(255, 198, 0, 0.25);
  --bs-focus-ring-opacity: 0.25;
  --bs-focus-ring-width: 0.25rem;
  --bs-primary: #006ea6 !important;
  --bs-primary-hover: #0095d9 !important;
  --bs-table-hover-bg: #fffdec;
  --bs-primary-bg-subtle: #d3edf8;
  --bs-warning-bg-subtle: #fff9f0;
  --bs-warning-border-subtle: #f8d6a3;
  --bs-danger-bg-subtle: #ffeff0;
}

.pagination {
  --bs-pagination-border-color: #ccc;

  --bs-pagination-active-bg: #006ea6;
  --bs-pagination-active-border-color: #006ea6;
  --bs-pagination-disabled-color: #bbb;
  --bs-pagination-disabled-bg: #f5f8f9;

  --bs-pagination-hover-bg: #e0e0e0;
  --bs-pagination-hover-color: #fff;
  --bs-pagination-hover-border-color: #ccc;

  --bs-pagination-focus-color: #006ea6;
  --bs-pagination-focus-box-shadow: unset;
}

.pagination .page-item a {
  color: #79b;
}

.pagination .page-item.active a {
  color: #fff;
}

/* =======
   Base / Reset
   ======= */
html {
  overflow-x: hidden;
}
html,
body {
  max-width: 100vw;
  overflow-x: clip;
}

body {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  background: #006699;
  display: flex;
  flex-direction: column;
  letter-spacing: 0.01em;
  min-height: 100vh;
  padding-right: 0 !important;
}

header {
  background-color: #006699;
}

.choices__list--dropdown,
.choices__list[aria-expanded="true"] {
  z-index: 1060;
}


@media (max-width: 991.98px) {
  header {
    position: sticky;
    top: 0;
    z-index: 1030;
  }
}

footer {
  background-color: #f2fbff;
  border-top: 1px solid #dee2e6;
  color: #aaa;
  padding: 0.5rem 0;
  text-align: center;
}

/* =======
   Typography / Font Utilities
   ======= */
.fs-7 {
  font-size: 0.9rem !important;
}

.fs-8 {
  font-size: 0.8rem !important;
}

.fs-9 {
  font-size: 0.7rem !important;
}

.w-40 {
  width: 40%;
  min-width: 285px;
}

.fw-extrabold {
  font-weight: 800 !important;
}

.highlight {
    background: rgb(255 246 119 / 40%);
    color: #333;
    border-radius: 3px;
    padding: .15em .2em;
    margin: -0.15em -0.2em;
}

.text-blue,
.card a.text-blue {
  color: #036DA6;
}

.text-green,
.text-success,
.card a.text-green {
 color: #066d26 !important;
}

.card-header-spinner {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
}

.card-header-spinner.htmx-request {
  visibility: visible;
  opacity: 1;
}

.sort-caret {
  font-size: 0.75em;
  opacity: 0.6;
}

/* =======
   Focus, Inputs, Placeholders
   ======= */
input:focus,
select:focus,
textarea:focus,
.hamburger-toggle:hover {
  box-shadow: 0 0 0 0.3rem rgba(255, 198, 0, 0.25) !important;
  outline: none;
}

.qty-group {
    width: 175px;
}

.form-select.select-locked {
  background-image: none !important;
  padding-right: 0.75rem;
}

.qty-input {
  font-size: 1.1rem;
  line-height: 1.4;
  font-weight: bold;
}

.finder-results .qty-input {
  font-size: 0.9rem;
  line-height: 1.1;
  font-weight: bold;
}

.qty-btn {
  background: linear-gradient(to bottom, #fff 65%, #eeeeee 100%);
  padding: .25rem .5rem;
  line-height: 1;
  touch-action: manipulation;
}

.qty-btn:hover,
.btn.qty-btn:focus-visible {
  background: linear-gradient(to bottom, #eee 65%, #e4e4e4 100%);
  color: #333;
}

.qty-icon {
  font-size: 1.3rem;
  line-height: 0;
  display: inline-block;
  vertical-align: middle;
}

input::placeholder,
textarea::placeholder {
  color: #c0c6cc !important;
  opacity: 1;
}

.input-group:focus-within,
.stacked-floating:focus-within {
  border-radius: 0.45rem;
  box-shadow: 0 0 0 0.3rem rgba(255, 198, 0, 0.25) !important;
  outline: none;
  transition: box-shadow 0.22s cubic-bezier(.4, 0, .2, 1), border-color 0.18s;
}

.stacked-floating {
    border-radius: 0.45rem;
    border: 1px solid #b5bdc4;
}

.form-floating > .form-control:not(:focus):placeholder-shown::placeholder {
  opacity: 0 !important;
}

.input-group .form-control {
  background: #fff;
  box-shadow: none !important;
}

.input-group .form-control:focus,
.stacked-floating .form-control:focus {
  box-shadow: none !important;
}

.form-control.form-error {
    border-color: #c9acac !important;
}

.input-group-lg .form-control.form-error {
    border-top-right-radius: var(--bs-border-radius-lg) !important;
    border-bottom-right-radius: var(--bs-border-radius-lg) !important;
}

.input-group .form-control,
.input-group .input-group-text,
.input-group .btn,
.stacked-floating {
  border-color: #b5bdc4;
}

.input-group .input-group-text {
  background: #fff;
  border-right: 0;
}

/* Ensure Quill editor content area is always solid white */
.ql-container .ql-editor,
.quill-editor-white .ql-editor {
  background-color: #fff !important;
}

/* Global Quill editor styling */
.sb-quill-editor,
.sb-quill-combined {
  background-color: #fff;
  border-radius: 0.55rem;
  transition: box-shadow 0.2s ease;
  overflow: hidden;
}

.ql-toolbar.ql-snow {
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-top-left-radius: 0.55rem;
  border-top-right-radius: 0.55rem;
  border-bottom: none;
  background: #f8fafc;
  padding: 0.35rem 0.5rem;
}

.ql-container.ql-snow {
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-top: none;
  border-bottom-left-radius: 0.55rem;
  border-bottom-right-radius: 0.55rem;
}

.ql-editor {
  min-height: 70px;
  font-size: 1rem;
  line-height: 1.45;
  padding: 0.75rem 0.875rem;
}

.ql-editor p {
  margin: 0 0 14px;
}

.ql-editor p:last-child {
  margin-bottom: 0;
}

.ql-toolbar .ql-divider {
  width: 28px;
  height: 24px;
  position: relative;
}

.ql-toolbar .ql-divider::before {
  content: '';
  position: absolute;
  left: 4px;
  right: 4px;
  top: 11px;
  border-top: 2px solid #6b7280;
}

.ql-editor hr {
  border: 0;
  border-top: 1px solid #ddd;
  margin: 14px 0;
}

.sb-quill-combined:focus-within {
  box-shadow: 0 0 0 0.3rem rgba(255, 198, 0, 0.25) !important;
  outline: none;
}

.input-group .input-group-text:last-child {
  border-right: 1px solid #b5bdc4 !important; /* Adds a visible border between input and the right .input-group-text */
}

.form-control {
  border-color: #aaa;
}

input.form-control  {
    padding: .5rem 1rem;
}

.modal-sm {
  --bs-modal-width: min(550px, calc(100vw - 2rem));
  margin-top: 14vh;
}

.modal-sm .modal-title.fs-4 {
    font-size: 1.6rem !important;
    font-weight: 500 !important;
}

.modal-sm .modal-header.text-bg-primary {
    background-color: transparent !important;
    color: #333 !important;
    border: none !important;
    text-align: center;
    display: block;
}

.modal-sm .modal-header .btn-close-custom {
    display: none;
}

.modal-sm .btn-cancel-prompt {
    background-color: #fee;
    color: #600;
    border: 1px solid rgba(113, 17, 17, 0.2);
}

.modal-sm .btn-cancel-prompt:hover {
    text-decoration: underline !important;
}

.btn-success  {
   background: linear-gradient(180deg, #0a7e47 2%, #1a915a 92%, #0e7f4a 100%);
   border-color: #127045;
}

.btn-success:hover {
  box-shadow: 0 0 0 0.3rem rgba(50, 255, 123, 0.3) !important;
}

.modal .btn.cancel-text {
  color: #777;
}

.modal .btn.cancel-text:hover {
  color: #900;
}

.modal .btn-outline-success {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0b5533;
    border-color: #429d72;
    background: linear-gradient(to bottom, #fff 55%, #ebebeb 100%);
}

.modal .btn-outline-success:hover {
    color: #0d5c38;
    background: linear-gradient(to bottom, #fff 55%, #e4e4e4 100%);
    box-shadow: 0 0 0 0.3rem rgba(154, 154, 154, 0.2) !important;
}

.modal .btn-outline-success:active {
    color: #0d5c38;
    background: linear-gradient(to bottom, #eee 55%, #f1f1f1 100%);
    box-shadow: 0 0 0 0.3rem rgba(154, 154, 154, 0.2) !important;
}

.finder-results .list-group-item {
    border-color: rgba(153, 215, 255, 0.25);
}

.finder-results .finder-actions-col {
    width: 100%;
}

.finder-results .finder-stock-col {
    width: 100% !important;
}

@media (max-width: 767.98px) {
    .finder-results .variation-finder-row {
        flex-wrap: wrap;
    }

    .finder-results .variation-finder-primary {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .finder-results .variation-finder-secondary {
        width: 100%;
        max-width: 100%;
        flex-shrink: 1;
        min-width: 0;
        flex-direction: column;
        align-items: center;
        gap: .75rem;
    }

    .finder-results .variation-finder-secondary .finder-actions-col {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .finder-results .variation-finder-secondary .variation-finder-stock-col {
        width: 100% !important;
        display: flex;
        justify-content: center;
    }
}

@media (min-width: 768px) {
    .finder-results .finder-actions-col {
        width: 200px;
    }

    .finder-results .finder-stock-col {
        width: 92px !important;
    }
}

.finder-header {
    background-color: rgba(126, 202, 255, 0.1);
}

.finder-header #finderDropdownBtn {
    background-color: rgba(238, 238, 238, 0.6) !important;
    color: #666;
    font-size: 1rem;
}

.finder-header #finderDropdownBtn:hover {
    background-color: rgba(238, 238, 238, 1) !important;
    color: #368;
    font-size: 1rem;
}

#finder-search-loading.htmx-request {
  display: inline-block !important;
}

.modal .form-select {
    padding: .4rem 2.25rem .4rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.8;
    border-radius: 0.45rem;
    border-color: #aaa;
}

.modal .border-dashed {
    border: 3px dashed #d7cdb1 !important;
}

.modal .thumb {
    width: 120px;
    height: 120px;
    border-radius: .55rem;
    border: 1px solid #ccc;
    box-shadow: 0 0 0 0.3rem rgb(221 221 221 / 60%);
    overflow: hidden;
    position: relative;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal .thumb.placeholder {
    width: 123px;
    height: 123px;
    box-shadow: none;
    cursor: default !important;
    border: 2px dashed #ccc;
}

.modal .thumb img {
    max-width: 100%; max-height: 100%; object-fit: cover;
}

.progress-absolute {
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 6px; background: rgba(0,0,0,.06);
}

.progress-absolute > div {
    height: 100%; width: 0%;
}

.form-label.fancy-label:has(+ .form-control[required])::after,
.form-label.fancy-label:has(+ textarea.form-control[required])::after,
.form-label.fancy-label:has(+ .form-select[required])::after,
.form-label.fancy-label:has(+ .input-group .form-control[required])::after {
  content: " *";
  color: var(--bs-danger, #dc3545);
  margin-left: 0;
}

/* Large input groups */
.input-group-lg > .form-control,
.input-group-lg > .input-group-text {
  border-radius: 0.5rem;
  font-size: 1.05rem;
}

.card-body .form-control-lg {
    min-height: 38px;
}

.card-body label {
    font-size: 0.9rem;
}

.card-footer {
    min-height: 35px;
}

.input-group-lg > .input-group-text,
.input-group-sm > .input-group-text {
  background: linear-gradient(130deg, #ffffff 55%, #e6f9ff 100%);
  color: #000;
}

/* Fancy labels */
.form-label.fancy-label {
  color: #004c72;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.1rem;
}

#card-loading.htmx-request {
  display: inline-flex !important;
  align-items: center;
  gap: .5rem;
}

.entity-view-success {
    background-color: #f2fbf1;
}

.entity-view-alert {
    background-color: #fffaf6;
}

.alert {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
}

.alert-dismissible .btn-close {
    padding: 0.95rem 1.2rem;
}

.alert-danger a {
    color: #58151c;
}
.alert-danger {
  box-shadow: 0 0 0 0.3rem rgba(255, 255, 255, 0.8) !important;
}
.alert-warning a {
    color: #664d03;
}
.alert-success, .alert-warning {
  box-shadow: 0 0 0 0.3rem rgba(255, 255, 255, 0.8) !important;
}


/* =======
   Buttons & Links
   ======= */
.btn-hamburger {
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
}

.btn-light.dropdown-toggle[aria-expanded="true"] {
  background-color: #ddd;
}

.btn-outline-dark {
  background: linear-gradient(to bottom, #fff 55%, #ebebeb 100%) !important;
  border-color: #999 !important;
  box-shadow: inherit;
  color: #222 !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.btn-outline-dark.dropdown-toggle[aria-expanded="true"],
.btn-light.dropdown-toggle[aria-expanded="true"] {
  border-color: #08b !important;
  box-shadow: 0 0 0 0.3rem rgba(255, 198, 0, 0.25) !important;
  transition: box-shadow 0.22s cubic-bezier(.4, 0, .2, 1), border-color 0.18s;
}

.btn-outline-dark:hover {
  background: linear-gradient(to bottom, #f3f3f3 20%, #e5e5e5 100%) !important;
  border-color: #555 !important;
  color: #000 !important;
}

.action-button {
    background: linear-gradient(160deg, #fffbee 20%, #fff 80%) !important;
    box-shadow:
      inset 0 0 0 4px rgba(255, 255, 255, 0.9),
      0 0 0 3px rgba(152, 152, 152, 0.12) !important;
    border: 1px solid rgba(76, 153, 96, 0.7) !important;
    padding-right: 0.3rem;
}

.action-button:hover {
    background: linear-gradient(160deg, #fff7d7 50%, #fff 80%) !important;
    box-shadow:
        inset 0 0 0 3px rgba(255, 255, 255, 0.9),
        0 0 0 4px rgba(204, 197, 153, 0.16) !important;
    border: 1px solid rgba(76, 153, 96, 0.4) !important;
}

@keyframes jiggle {
    0% { transform: translateX(0); }
    50% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}
.icon-jiggle {
    /* Apply the animation: name | duration | timing | iteration-count */
    animation: jiggle 0.8s ease-in-out 6;
}

.action-button-wrapper {
  container-type: inline-size;
  width: 100%;
}

@container (max-width: 240px) {
  .action-button-icon {
    display: none;
  }

  .action-button {
    padding-left: 0.8rem;
  }
}

.hover-underline:hover {
  text-decoration: underline !important;
}

.dropdown-item {
  border-radius: 5px;
  margin-left: 4px;
  width: calc(100% - 8px);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: #406176;
  color: #fff;
}

.dropdown-item.text-danger:hover {
  background-color: #911;
  color: #fff !important;
}

a[data-bs-toggle="collapse"] .chevron {
  transition: transform .2s ease;
}

a[aria-expanded="true"] .chevron {
  transform: rotate(90deg);
}

.text-danger {
  color: #900;
}

/* Header link hover */
header a.text-light {
  transition: color 0.2s ease-in-out;
}

header a.text-light:hover {
  color: #f4ffb7 !important;
}

a.text-decoration-none.fs-8:hover,
a.text-decoration-none.fs-7:hover,
a.text-muted.text-decoration-none:hover {
  text-decoration: underline !important;
}

/* =======
   Cards, Toolbars, Headers
   ======= */
.card-header {
  --bs-card-cap-padding-y: 0.4rem !important;
}

.card.rounded {
   box-shadow: 0 0 0px 3px rgb(150 176 187 / 11%);
}
.dashboard-container {
   box-shadow: 0 0 0px 4px rgb(150 176 187 / 6%);
}
.toolbar,
.sidebar {
  box-shadow: 0 0 6px 1px rgba(131, 131, 131, 0.2);
}

.dropdown-menu.show,
.dropdown-menu {
  z-index: 2000;
}

.modal.modal-choices-front .modal-body {
  overflow: visible;
}

.modal.modal-choices-front .modal-dialog-scrollable .modal-body {
  overflow: visible !important;
}

.modal.modal-choices-front .choices__list--dropdown {
  z-index: 2055;
}

.packing-list-row:last-child {
  border-bottom: 0 !important;
}

.dropdown-menu.show {
  box-shadow: 0 0 8px 1px rgba(131, 131, 131, 0.3);
  min-width: 7.5rem;
}

.table {
    --bs-table-border-color: rgba(0, 0, 0, 0.07);
}

.card {
    --bs-card-border-color: rgba(0, 0, 0, 0.2);
}

.card table td a {
    text-decoration: none;
    color: #000;
}

#primary-card .card-header {
  min-height: 38px;
}

.tooltip-inner {
  max-width: 320px !important;
  padding: 0.4rem 0.6rem;
}

.tooltip-inner {
  font-size: 0.85rem !important;
}

.shadow-bottom {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06) !important;
}

.progress-bar-green {
    background-color: #17A010 !important;
}

.progress-bar-orange {
    background-color: #b16500 !important;
}

.toolbar.border-bottom {
  border-bottom: 1px solid #ccc !important;
}

.toolbar .input-group {
  border-radius: 0.25rem;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.12);
}

.toolbar .input-group .form-control,
.toolbar .input-group .btn,
.toolbar .input-group .input-group-text {
  border-color: #aaa;
}

.toolbar.p-2-5 {
  padding: 0.75rem 0.75rem 0.75rem 0.95rem !important;
}

.toolbar .btn-outline-dark {
  white-space: nowrap;
  margin-right: 0.5rem;
}

#toolbar-search .dropdown-item {
    font-size: 0.9rem;
}

.sb-progress {
    height: 0.55rem;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 1rem;
    overflow: hidden;
  }

.sb-progress-bar {
    width: var(--target-width, 0%);
    transform-origin: left;
    animation: sbFillOnLoad 1.2s ease forwards;
    animation-delay: .2s;

    transition: width 450ms cubic-bezier(.22,1,.36,1), background-color 300ms ease;
    background-image: linear-gradient(to right, rgba(255,255,255,.18), rgba(255,255,255,0));
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  }

  @keyframes sbFillOnLoad {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
  }

.stock-box.small-box {
  box-shadow: none !important;
}

.no-progress-anim .sb-progress-bar {
  animation: none !important;
  transform: none !important;
  width: var(--target-width, 0%);
}
.small-box .stock-box-top {
  font-size: 1rem;
  font-weight: 600;
}

.stage-line {
  height: 4px;
  border-radius: 999px;
}
.stage-line.stage-green {
  background-color: #8fda92;
}
.stage-line.stage-partial {
  background-color: #e2c882;
}
.bi.stage-partial {
    color: #af9550;
}

@keyframes fillBar {
    from { width: 0; }
    to { width: var(--target-width); }
}

/* Colors */
.sb-progress-bar.sb-green {
    background-color: #17A010;
    box-shadow: 0 2px 6px rgba(23,160,16,0.35);
}
.sb-progress-bar.sb-orange {
    background-color: #c98600;
    box-shadow: 0 2px 6px rgba(255,138,0,0.35);
}
.sb-progress-bar.sb-red {
    background-color: #E53935;
    box-shadow: 0 2px 6px rgba(229,57,53,0.35);
}

@media (prefers-reduced-motion: reduce) {
    .sb-progress-bar { animation: none; width: var(--target-width); }
}

/* Flash messages helper */
.flash-v3 {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%) translateY(-60px);
  min-width: 190px;
  max-width: min(750px, 96vw);
  width: fit-content;
  display: inline-block;
  padding: 12px 26px;
  z-index: 9999;
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(245, 255, 248, 0.85);
  color: rgba(5, 76, 27, 1);
  border: 1px solid rgba(10, 65, 7, 0.85);
  box-shadow: 0 0 0px 3px rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  /* box-shadow: 0 0 0 0.04rem rgba(255, 215, 0, 0.65) !important; */
  backdrop-filter: blur(8px);
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  opacity: 0;
  pointer-events: auto;
  cursor: pointer;
  animation:
    flash-v3-in 0.5s cubic-bezier(.38,.92,.43,1.13) forwards,
    flash-v3-out 0.4s 9.3s ease-in forwards;
  transition: opacity 0.35s, transform 0.25s;
}
.flash-v3.hidden {
  opacity: 0 !important;
  pointer-events: none;
  transform: translateX(-50%) translateY(-60px) scale(0.97);
}
.flash-v3--error {
  background: rgba(116, 21, 21, 0.76);
  color: #fff;
  border: 1px solid rgba(255, 120, 120, 0.4);
  box-shadow: 0 8px 32px rgba(190, 40, 40, 0.22);
}
@keyframes flash-v3-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-60px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.sb-toast-stack {
  position: fixed;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 20px));
  z-index: 10020;
  pointer-events: none;
}

.sb-toast {
  pointer-events: auto;
  border-radius: 12px;
  border: 1px solid rgb(10 66 98 / 50%);
  background: rgb(254 255 237 / 75%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 0 3px rgb(150 176 187 / 15%), 0 10px 24px rgba(24, 42, 68, 0.18);
  color: #163255;
  padding: 12px 14px;
  transition: opacity 0.45s ease, transform 0.25s ease;
}

.sb-toast--error {
  border-color: rgba(145, 47, 47, 0.28);
  background: #fff4f4;
  color: #5f1717;
}

.sb-toast__message {
  margin: 0;
  padding-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
  border-bottom: 1px solid rgb(123 167 186 / 25%);
}

.sb-toast__actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.sb-toast--hiding {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}
@keyframes flash-v3-out {
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-30px) scale(0.97);
    pointer-events: none;
  }
}

/* Gradient helper */
.bg-gradient {
  background-image: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.00) 0%,
    rgba(255, 255, 255, 0.15) 4%,
    rgba(255, 255, 255, 0.00) 7%
  ) !important;
  background-position: top center;
}

/* =======
   Contextual Backgrounds / Badges
   ======= */
.py-15 {
  padding-top: .35rem !important;
  padding-bottom: .35rem !important;
}
.text-bg-primary {
  background-color: var(--bs-primary) !important;
  color: #fff !important;
}

.text-bg-success {
  background-color: rgb(0, 145, 47) !important;
  color: #fff !important;
}

.text-bg-warning {
  background-color: rgb(177, 101, 0) !important;
  color: #fff !important;
}

.text-bg-grey {
    background-color: rgb(83, 112, 129) !important;
    color: #fff !important;
}

.bg-primary,
.btn-primary {
  background-color: var(--bs-primary) !important;
}

/* Filter pill */
.bg-filter {
  background-color: #fffbea !important;
  border-color: #d7cb6c !important;
  box-shadow: 0 0 0 0.2rem rgba(208, 208, 208, 0.25) !important;
}

.bg-filter:hover {
  color: #666;
  background-color: #fffcf4 !important;
  box-shadow: 0 0 0 0.2rem rgba(208, 208, 208, 0.45) !important;
}

.subtle-bg {
    background: rgba(255,255,255,0.12);
}
.subtle-bg:hover {
    background: rgba(255,255,255,0.05);
}
.subtle-bg-light {
    background: rgba(12, 109, 167, 0.10);
}
.subtle-bg-light:hover {
    background: rgba(14, 91, 150, 0.04);
}

.document-line-items tbody tr:last-child td {
    border-bottom: var(--bs-border-width) solid var(--bs-border-color);
}

.table-filters-cell {
  --bs-table-accent-bg: #f8f9fa;
  --bs-table-hover-bg: #f8f9fa;
  background-color: #f8f9fa !important;
}

.totals-table table tbody tr:last-child,
.totals-table table tbody tr:last-child td,
.totals-table table tbody tr:last-child th {
    border-bottom: none !important;
}

/* =======
   Sidebar / Offcanvas / Layout
   ======= */
.app-sidebar-offcanvas,
#sidebarOffcanvas,
#settingsSidebarOffcanvas {
     --bs-offcanvas-width: 250px;
     border-right: 2px solid #016698;
     background: rgba(255, 255, 255, 0.65);
     backdrop-filter: blur(10px);
     -webkit-backdrop-filter: blur(10px);
     box-shadow: 5px 0 15px -5px rgba(0, 0, 0, 0.45);
}

.sidebar {
  background: rgba(229, 242, 249, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-right: 2px solid #aec7cc;
  flex: 0 0 240px;
  max-width: 100%;
  width: 240px;
}

.sidebar .nav .nav-link .bi.green-icon {
  color: #60b036;
}

.sidebar .submenu,
.offcanvas .submenu {
  margin-bottom: 0rem;
  margin-top: 0rem;
  padding-left: 1.2rem;
}

.offcanvas .submenu {
  padding-left: 0.8rem;
}

.offcanvas-header,
.offcanvas-header .btn-close {
    color: #fff !important;
    background-color: #016699;
}

.sidebar .submenu .nav-link,
.offcanvas .submenu .nav-link {
  background: none;
  border-radius: 0.25rem;
  color: #333;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0;
  margin-right: 1.2rem;
  padding: 0.2rem 0.5rem;
  transition: background-color 0s;
}

.offcanvas .submenu .nav-link {
  margin-right: 0.9rem;
}

.sidebar .submenu .nav-link:hover,
.sidebar .submenu .nav-link:focus,
.offcanvas .submenu .nav-link:hover,
.offcanvas .submenu .nav-link:focus,
.sidebar .submenu .nav-link.active:hover,
.sidebar .submenu .nav-link.active:focus {
  background: #0078b0;
  color: #fff !important;
  transition: background-color 0s;
}

.sidebar .submenu .nav-link.active {
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8));
}

.sidebar li .nav-link {
  font-size: 1.3rem;
  font-weight: 800;
}

.vr {
 opacity: 0.1;
}

.sidebar hr {
  border-color: #ccc;
}

.offcanvas-body {
    padding: 0.5rem 1rem;
}

.offcanvas .submenu .nav-link {
  margin-bottom: 0.2rem;
}

.offcanvas-body .nav a.nav-link {
  color: #000 !important;
}

.offcanvas-body .nav i.bi {
  color: #000 !important;
}

.offcanvas-backdrop {
  left: 0;                     /* start */
  transition: left 0.4s ease;    /* animate */
}

.offcanvas-backdrop.show {
  left: 250px;                 /* match offcanvas width */
}

.main-layout {
  background: linear-gradient(170deg, #fff 20%, #cef 45%, #fef 70%, #fff 80%);
  background-size: 100% 1200px;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.main-content {
  flex: 1 1 0%;
  min-width: 0;
  padding: 2rem 2rem 1rem 2rem;
}

.pagination-wrapper {
  display: inline-block;
  border-radius: 50rem; /* makes it pill-shaped */
  box-shadow: 0 0 0 0.1rem rgba(208, 208, 208, 0.16);
}

.pagination .page-link {
  font-size: 0.9rem;
  border-radius: 0; /* flatten all middle buttons */
}

.pagination .page-item:first-child .page-link {
  border-top-left-radius: 50rem !important;
  border-bottom-left-radius: 50rem !important;
}

.pagination .page-item:last-child .page-link {
  border-top-right-radius: 50rem !important;
  border-bottom-right-radius: 50rem !important;
}

.record-tally {
    line-height: 3;
}

/* =======
   Tables
   ======= */
.table-hover {
  --bs-table-hover-bg: #fffdec;
}

.table-hover thead th {
  border-bottom: 1px solid #ddd;
}

.table-light tr th {
  background-color: rgb(226 235 240 / 60%);
  color: #888;
  font-size: 0.8rem;
  font-weight: normal;
}

.card table tr th:first-child,
.card table tr td:first-child {
  padding-left: 1.3rem;
}

.card table tr th:last-child,
.card table tr td:last-child {
  padding-right: 1.3rem;
}

.card table tr:last-child {
  border-bottom: 1px solid #fff;
}

/* Options column widths */
.th-options-width {
  width: 50px;
}

/* --- slide + quick entrance --- */
@keyframes rowSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  60% {
    opacity: 1;
    transform: translateY(2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- long highlight fade --- */
@keyframes rowHighlightFade {
  0%   { background-color: #fffde2; }
  90%  { background-color: #fffde2; }
  100% { background-color: transparent; }
}

/* Apply both animations together */
.table tbody tr.row-enter {
  animation:
    rowSlideIn 0.3s ease-out,
    rowHighlightFade 3s ease-out forwards;
}

.table tbody tr.row-enter > td {
  animation:
    rowSlideIn 0.3s ease-out,
    rowHighlightFade 3s ease-out forwards;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .table tbody tr.row-enter,
  .table tbody tr.row-enter > td {
    animation: none;
  }
}

/* Whole-row soft yellow flash */
.table tbody tr.row-updated > td {
  animation: sbRowFlash 4s ease-in-out;
}

@keyframes sbRowFlash {
  0%   { background-color: #fff7bf; }   /* light pastel yellow */
  40%  { background-color: #fffbe5; }
  100% { background-color: transparent; }
}

/* =======
   Activity Feed timeline
   ======= */
.dashboard-container {
    position: relative;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 0.4rem;
    border: 1px solid rgba(73, 132, 156, 0.15);
}

.entity-feed-container {
    position: relative;
    background: rgba(245, 251, 255, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 0.4rem;
    border: 1px solid rgba(73, 132, 156, 0.18);
    box-shadow: 0 0 0px 4px rgb(150 176 187 / 6%);
}
.activity-heading {
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 0) 30%
  );
}

.timeline-item p:last-child {
  margin-bottom: 0 !important;
}

.timeline {
  --line-x: 2.5rem;
  position: relative;
  padding: 1.5rem 1.5rem 1.5rem calc(var(--line-x) + 1.5rem);
}

/* vertical line */
.timeline::before {
  content: "";
  position: absolute;
  top: 2rem;
  bottom: 4rem;
  left: var(--line-x);
  width: 2px;
  background: #d3efcf;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.7rem;
  margin-left: 0.9rem;
}

.timeline-item .timeline-avatar {
  position: absolute;
  top: -0.3rem;
  left: -2.4rem;
  transform: translateX(-50%);
  width: 34px;
  height: 34px;
  border-radius: 20%;
  object-fit: cover;
  transition: transform 0.22s ease-in-out;
  background: #fff;
  border: 3px solid var(--bs-body-bg);
  box-shadow: 0 0 0 1px #6fc56b;
  z-index: 2;
}

.timeline-item .timeline-avatar:hover {
  transform: translateX(-50%) scale(1.3);
}

.timeline-item:last-child {
    margin-bottom: 0 !important;
}

/* =======
   Sprite Icons (Small)
   ======= */
/* Base sprite setup */
.icon-sm {
  background-image: url('/v3/theme_v3/images/icons-sm_v3@2x.png');
  background-repeat: no-repeat;
  background-size: 55px 290px; /* 110×580 -> half for @2x */
  display: inline-block;
  width: 55px; /* 110px / 2 */
}

/* Individual icons (top-to-bottom in the sprite) */
.icon-sm--dashboard {
  background-position: 0 -2px;  /* start ~4/2 */
  height: 39px;                 /* ~77/2 */
}

.icon-sm--accounts {
  background-position: 0 -51.5px; /* start ~103/2 */
  height: 40px;                   /* ~80/2 */
}

.icon-sm--inventory {
  background-position: 0 -101px; /* start ~202/2 */
  height: 45px;                  /* ~90/2 */
}

.icon-sm--reports {
  background-position: 0 -152px; /* start ~304/2 */
  height: 41px;                  /* ~82/2 */
}

.icon-sm--documents {
  background-position: 0 -202.5px; /* start ~405/2 */
  height: 41px;                    /* ~81/2 (rounded) */
}

.icon-sm--accounting {
  background-position: 0 -250.5px; /* start ~501/2 */
  height: 37px;                    /* ~73/2 */
}

/* =======
   Popovers
   ======= */
.popover-dark {
  background-color: #212529;
  border: 1px solid #343a40;
  color: #f8f9fa;
}

.popover-dark .popover-body {
  color: #f8f9fa;
  padding-bottom: 0.35rem;
  padding-top: 0.35rem;
}

.popover-dark span.text-muted {
  color: #bcc4cd !important;
}

.popover-dark .popover-arrow::before,
.popover-dark .popover-arrow::after {
  border-right-color: #212529 !important;
}

.popover-dark[data-popper-placement^="right"] > .popover-arrow {
  left: -5px;
}

/* =======
   Dropdowns
   ======= */
.card-body .dropdown-toggle::after {
  margin-left: 0;
}

.table .dropdown {
    position: static;
}

/* =======
   Choices.js (Select Enhancer)
   ======= */
.choices {
  margin-bottom: 15px;
}

.choices[data-type*=select-one] .choices__inner {
  min-height: 38px;
  padding-top: 3px;
  padding-bottom: 3px;
}

.choices[data-type*=select-one] .choices__list--single {
  padding-top: 6px;
  padding-bottom: 6px;
}

.choices__inner {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  background: linear-gradient(to bottom, #fff 60%, #f0f0f0 100%) !important;
  background-color: initial;
  border: 1px solid #999;
  border-radius: 6px;
  min-height: 36px;
  padding: 2px 8px; /* top/bottom, left/right */
}

.modal .choices__inner {
    min-height: initial;
    padding: 0px 8px;
}

.modal .choices__list--single {
    font-size: 1rem;
    padding: 9px 16px 9px 8px;
}

.multi-select-style .choices[data-type*=select-multiple] .choices__inner,
.multi-select-style .choices.is-multiple .choices__inner {
    background: #fff !important;
    padding: 4px;
    min-height: initial;
    font-size: 1rem;
    white-space: normal;
    text-overflow: initial;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
    gap: 4px;
    min-height: 44px;
    max-height: 140px;
    overflow-y: auto;
}

.multi-select-style .choices[data-type*=select-multiple] .choices__list--multiple,
.multi-select-style .choices.is-multiple .choices__list--multiple {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 0;
}

.multi-select-style .choices[data-type*=select-multiple] .choices__input,
.multi-select-style .choices.is-multiple .choices__input {
    font-size: 1rem;
    background-color: #fff;
    padding: 6px 0 6px 10px;
    margin-bottom: 0;
    color: #333;
}

.multi-select-style .choices[data-type*=select-multiple] .choices__list--multiple .choices__item,
.multi-select-style .choices.is-multiple .choices__list--multiple .choices__item {
    font-size: 0.9rem;
    margin-top: 2px;
    padding: 4px 14px;
}

.choices__list--multiple .choices__item {
    background-color: #036da6;
    border: 1px solid #004971;
}

.choices__list--multiple .choices__item.is-highlighted {
    background-color: #0085cc;
    border: 1px solid #0067a0;
}

.choices[data-type*=select-one] .choices__input {
  padding: 5px 10px;
}

.choices .choices__input:focus {
  box-shadow: none !important;
  outline: none !important;
}

.modal .choices__list--dropdown {
    max-height: 280px !important;
    border: 1px solid #4af;
    box-shadow: 2px 2px 8px 0px rgba(136, 136, 136, 0.6);
    border-radius: 6px;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    z-index: 2000 !important;
}

.modal .choices__list--dropdown .choices__list,
.modal .choices__list--dropdown {
    max-height: 230px;
}

.choices .choices__list--dropdown {
  opacity: 0;
  transform: translateY(-4px) scaleY(0.98);
  transform-origin: top;
  transition: opacity 140ms ease, transform 200ms ease;
}

.choices .choices__list--dropdown.is-active {
  opacity: 1;
  transform: translateY(0) scaleY(1);
}

.choices.is-flipped .choices__list--dropdown {
  transform-origin: bottom;
  transform: translateY(4px) scaleY(0.98);
}

.choices.is-open .choices__inner,
.choices.is-open .choices__list--dropdown,
.choices.is-open.is-flipped .choices__list--dropdown {
  border-color: #4af;
  box-shadow: 2px 2px 8px 0px rgba(136, 136, 136, 0.6);
  border-radius: 6px;
}

.choices__list--dropdown .choices__item {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 5px 8px;
}

.choices__placeholder {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.9;
}

.modal .choices__list--dropdown,
.modal .choices__list[aria-expanded] {

}

/* =======
   Modals
   ======= */
body .modal-backdrop.show {
  background-color: #000 !important;
  opacity: 0.8 !important;
}

.modal-content {
  background:
    linear-gradient(165deg, #fff 25%, #cef 55%, #fef 85%, #fff 90%),
    rgba(255,255,255,0.4);
  background-blend-mode: lighten;
  background-clip: padding-box;
  border: 2px solid #333;
  border-radius: 0.6rem;
  box-shadow: 6px 0 18px rgba(144, 206, 255, 0.7);
  outline: 10px solid rgba(144, 206, 255, 0.1);
  outline-offset: 0px;
}

.modal-dialog-scrollable .modal-body {
    overflow-y: auto !important;
}

html.modal-open,
body.modal-open {
  overflow: hidden !important;
  height: 100%;
}

.modal-footer {
  background-color: #f4f9fe;
  border-top: 1px solid #8fa59e;
  position: sticky;
  bottom: 0;
  z-index: 5; /* keep it above body content */
  box-shadow: 0 -2px 4px rgba(0,0,0,0.05); /* subtle top shadow */
}

.btn-save {
  font-weight: bold;
}

.btn-success {
    border: 1px solid #061;
    box-shadow: 0 0 0px 4px rgba(0, 0, 0, 0.11);
}

.app-floatbar,
.doc-floatbar {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 1029;
  pointer-events: none;
  animation: floatbar-in 1.2s cubic-bezier(.22,1,.36,1) both;
}

.app-floatbar,
.doc-floatbar {
  bottom: 14px;
  padding: 0 0.2rem;
}

.app-floatbar-inner,
.doc-floatbar-inner {
  pointer-events: auto;
  background: rgba(106, 155, 177, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 0.6rem;
  box-shadow: 0 0 0 5px rgba(74, 158, 201, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.app-floatbar-inner {
  padding: 0.7rem 0.7rem;
}

.app-floatbar-link {
  text-decoration: none;
  color: #fff;
  font-weight: 600;
}

.app-floatbar-link:hover {
  color: #f1f6f8;
}

@keyframes floatbar-in {
  from {
    transform: translateY(120%);
  }
  to {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-floatbar,
  .doc-floatbar {
    animation: none;
  }
}

.app-floatbar-spacer {
  height: 54px;
}

@media (max-width: 767.98px) {
  .app-floatbar {
    bottom: 10px;
    padding: 0 0.5rem;
  }

  .app-floatbar-inner {
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
  }

  .app-floatbar-spacer {
    height: 106px;
  }
}

.modal-header {
  padding: 1rem 1rem 1rem 2rem;
}

.modal-form.modal-body {
  padding: 2rem 3.5rem;
}

.modal-item-photo-box {
  box-shadow: 0 0 0 0.3rem rgba(208, 208, 208, 0.35) !important;
  border-color: #bbb !important;
  height: 180px;
  margin-top: 1rem;
  width: 180px;
}

.modal-fullscreen .modal-body {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  height: 100vh;
  overflow: visible;
}

.modal-fullscreen .modal-header .btn-close {
    margin-right: 1.5rem;
}

#zoomModalImg {
  max-width: 98vw;
  max-height: 92vh;
  border-radius: 0.5rem !important;
  box-shadow: 0 0.5rem 4rem rgba(0,0,0,0.45);
  object-fit: contain;
}

/* =======
   Inventory Thumbnails
   ======= */
.inventory-thumb-wrapper {
  display: inline-block;
  width: 100px;
  height: 100px;
  margin: 1.2rem;
  position: relative;
}

.inventory-thumb-wrapper.sm-thumb {
  width: 80px !important;
  height: 80px !important;
}

.inventory-thumb-wrapper.xs-thumb {
  width: 60px !important;
  height: 60px !important;
  margin: 0.4rem !important;
}

/* Thumbnails - base */
.thumb {
  position: relative;
  overflow: hidden;
  border-radius: .55rem;
  border: 1px solid #ccc;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumb-image { max-width: 100%; max-height: 100%; object-fit: cover; transition: opacity .3s ease; }

/* Overlay (bottom blur bar) */
.thumb-overlay-blur {
  position: absolute; bottom: 0; left: 0; right: 0;
  text-align: center; padding: .2rem .5rem;
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-bottom-left-radius: inherit; border-bottom-right-radius: inherit;
  overflow: hidden; opacity: 1; transform: none; /* base default */
}
.thumb-overlay-blur a { color: inherit; text-decoration: none; font-weight: 600; font-size: .8rem; }
.thumb-overlay-blur a:hover { text-decoration: underline; }

/* Deleting state (modifier) */
.thumb--deleting .thumb-image { opacity: .3; }
.thumb-overlay-blur--deleting a { pointer-events: none; opacity: .7; }

/* Grid-specific hover behavior (only the animation bit stays scoped) */
#photo-grid .thumb-overlay-blur { opacity: 0; transform: translateY(100%); transition: all .25s ease-in-out; }
#photo-grid .thumb:hover .thumb-overlay-blur { opacity: 1; transform: translateY(0); }
#photo-grid .thumb.thumb-draggable { cursor: grab; }
#photo-grid .thumb.thumb-draggable:active { cursor: grabbing; }

/* Placeholder (kept minimal) */
.thumb.placeholder {
  box-shadow: none; cursor: default !important;
  border: 2px dashed #ccc; opacity: .5;
}

.thumb-overlay-blur a:hover {
  text-decoration: underline;
}

.zoom-btn {
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #9eeaf9;
  border-radius: 50%;
  color: #0078b0;
  display: flex;
  font-size: 0.9rem;
  height: 32px;
  justify-content: center;
  opacity: 0;
  padding: 0;
  position: absolute;
  right: -5px;
  top: -6px;
  transition: opacity 0.38s, background 0.18s, color 0.18s;
  width: 32px;
  z-index: 2;
}

.inventory-thumb-wrapper:hover .zoom-btn {
  opacity: 1;
}

.document-line-items > tbody > tr > td {
  padding-bottom: 1rem;
  padding-top: 1rem;
  vertical-align: top;
}

.zoom-btn:hover,
.zoom-btn:focus {
  background: #0078b0;
  border-color: #0078b0;
  color: #fff;
}

.inventory-thumb.sm-thumb {
  height: 80px !important;
  width: 80px !important;
}

.inventory-thumb.xs-thumb {
  height: 60px !important;
  width: 60px !important;
}

.inventory-thumb {
  background: #f4f9fe;
  border: 1px solid #ccc;
  border-radius: 0.45rem;
  height: 100px;
  width: 100px;
  margin-bottom: 0.3rem;
  margin-right: 1rem;
  object-fit: cover;
  outline: 3px solid rgba(204, 204, 204, 0.2);
}

.inventory-lg-thumb {
  background: #f4f9fe;
  border: 1px solid #ccc;
  border-radius: 0.45rem;
  max-width: 500px;
  max-height: 500px;
  width: 100%;
  height: auto;
  object-fit: contain; /* show full image without cropping */
  outline: 5px solid rgba(204, 204, 204, 0.18);
}

#zoomModal .modal-dialog { height: 100vh; }
#zoomModal .modal-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}
#zoomModal .modal-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#zoomModalImg {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
}

/* ======
   Documents List
   ===== */
.doc-border {
 height: 6px;
 width: 100%;
 display: block;
 position: relative;
 overflow: hidden;
 border-bottom: 1px solid #ddd;
 box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.doc-border::before {
 content: "";
 position: absolute;
 inset: 0;
 background-size: auto;
 transform: translate3d(0, 0, 0);
 background-image: var(--stripe-gradient);
}

.invoice-border {
 --stripe-gradient: repeating-linear-gradient(
   135deg,
   rgba(255, 255, 255, 0.8) 0 16px,
   rgba(187, 13, 13, 0.7) 16px 36px,
   rgba(255, 255, 255, 0.8) 36px 52px,
   rgba(18, 151, 187, 0.8) 52px 72px
 );
}

.order-border {
 --stripe-gradient: repeating-linear-gradient(
   135deg,
   rgba(255, 255, 255, 0.8) 0 16px,
   rgba(187, 117, 13, 0.7) 16px 36px,
   rgba(255, 255, 255, 0.8) 36px 52px,
   rgba(18, 151, 187, 0.8) 52px 72px
 );
}

.estimate-border {
 --stripe-gradient: repeating-linear-gradient(
   135deg,
   rgba(255, 255, 255, 0.8) 0 26px,
   rgba(18, 151, 187, 0.8) 26px 64px
 );
}

.po-border {
 --stripe-gradient: repeating-linear-gradient(
   135deg,
   rgba(255, 255, 255, 0.8) 0 26px,
   rgba(29, 160, 49, 0.8) 26px 64px
 );
}

.transfer-border {
 --stripe-gradient: repeating-linear-gradient(
   135deg,
   rgba(255, 255, 255, 0.8) 0 26px,
   rgba(180, 42, 85, 0.8) 26px 64px
 );
}

.status-badge {
 font-size: 0.85rem;
 color: #333;
 background-color: rgba(238, 238, 238, 0.3);
 display: inline-block;
 border: 1px solid rgba(209, 209, 209, 0.6);
 border-radius: 1rem;
 padding: 0.05rem 0.7rem 0.05rem 0.6rem;
 /* margin-left: -0.45rem; */
 display: inline-flex;
 align-items: center;
 justify-content: center;
}

@media (max-width: 767.98px) {
 .status-badge {
   border: none;
   padding: 0;
   margin-left: 8px;
   background-color: transparent;
 }
}

.status-grey
a.status-grey {
 color: #989898 !important;
}

.status-green,
a.status-green {
 color: #00890b !important;
}

span.status-badge:has(.status-green) {
    background-color: rgba(0, 159, 13, 0.09);
    border-color: rgba(106, 181, 112, 0.8);
}

.status-blue,
a.status-blue {
 color: #177ca4 !important;
}

.status-orange,
a.status-orange {
 color: #ac660d !important;
}

.status-red,
a.status-red {
 color: #811 !important;
}

/* =======
   Date Picker
   ===== */
.datepicker {
  z-index: 1080;
  transform: translateX(-20px);
}

.datepicker.active .datepicker-picker {
  animation: datepicker-open 200ms ease both;
  transform-origin: top;
}

.datepicker-dropdown.datepicker-orient-top.active .datepicker-picker {
  animation-name: datepicker-open-up;
  transform-origin: bottom;
}

@keyframes datepicker-open {
  from {
    opacity: 0;
    transform: translateY(-4px) scaleY(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

@keyframes datepicker-open-up {
  from {
    opacity: 0;
    transform: translateY(4px) scaleY(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

.datepicker .datepicker-header .prev-btn,
.datepicker .datepicker-header .next-btn,
.datepicker .datepicker-header .datepicker-title,
.datepicker .datepicker-header .view-switch {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.datepicker-controls button.view-switch {
   font-size: 0.9rem;
   font-weight: 600;
}

.datepicker-controls .next-button,
.datepicker-controls .prev-button {
   position: relative;
   top: -2px;
}

.datepicker-view {
   padding: 6px;
   width: 18.5rem;
}

.datepicker-header .datepicker-controls {
   padding: 4px 2px;
}

.datepicker .datepicker-header .prev-btn:focus,
.datepicker .datepicker-header .next-btn:focus,
.datepicker .datepicker-header .datepicker-title:focus {
  outline: none !important;
  box-shadow: none !important;
}

.datepicker-cell.selected,
.datepicker-cell.selected:hover {
   background-color: #046da6;
   color: #fff;
   font-weight: 500;
}

.datepicker span {
   border-radius: 1rem;
   font-size: 1.1rem;
}

.datepicker-cell {
   height: 2.2rem;
}

.datepicker-cell:not(.disabled):hover {
   background-color: #fff6b9;
   color: #051;
}

.datepicker-main,
.datepicker-picker {
   border-radius: 0.5rem !important;
}

.datepicker-dropdown {
 box-shadow: 0 0 0 4px rgba(0,0,0,.09) !important;
 border: 1px solid #6bf !important;
 border-radius: 0.5rem !important;
 margin-top: 8px !important;
 padding-top: 0;
}

.datepicker-picker {
   background-color: rgba(255, 255, 255, 0.8);
   backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(6px);
}

/* Optional: soften header background */
.datepicker .datepicker-header {
 background-color: rgba(0,0,0,0.05) !important;
 border-bottom: none !important;
}

/* =======
   Stock Box (In-table badges)
   ======= */
.stock-box {
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  box-shadow: 0 0 0 0.2rem rgba(208, 208, 208, 0.18) !important;
  margin: 4px 0;
  cursor: default;
  display: inline-flex;
  flex-direction: column;
  min-width: 86px;
  outline: none;
  overflow: hidden;
  text-align: center;
}

.stock-box-top {
  background: #fff;
  font-size: 1rem;
  font-weight: bold;
  padding: 0.1rem 0.6rem;
}

.stock-box-bottom {
  color: #495057;
  background-color: #def1f5;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.1rem 0.4rem;
}

/* Variants */
.stock-box-green {
  border-color: #c2d2cb;
}

.stock-box-green .stock-box-bottom {
  background-color: #e9f7ef;
  color: #198754;
}

.stock-box-yellow {
  border-color: #dad6c8;
}

.stock-box-yellow .stock-box-bottom {
  background-color: #fff9e6;
  color: #977717;
}

.stock-box-red {
  border-color: #dbccc9;
}

.stock-box-red .stock-box-bottom {
  background-color: #fdecea;
  color: #a34535;
}

/* =======
   Category List (Card)
   ======= */
/* 3-col grid: handle | label | count */
.category-list .cat-row {
  align-items: center;
  column-gap: 0.5rem;
  display: grid;
  font-size: 0.85rem;
  grid-template-columns: 1.25rem 1fr 3.5rem;
}

.category-list.category-list--filter-only .cat-row {
  grid-template-columns: 1fr 3.5rem;
}

.category-list .handle {
  align-items: center;
  color: #6c757d;
  cursor: grab;
  display: inline-flex;
  justify-content: center;
}

.category-list .label-wrap {
  align-items: center;
  display: flex;
  min-width: 0;
}

.category-list .is-child .label-wrap {
  padding-left: 0.5rem;
}

/* Base: thin bottom, no top (control top for parents) */
.category-list .list-group-item {
  border-bottom: 1px solid #e9ecef !important;
  border-top: 0 !important;
  padding: 8px 2px;
}

.category-list .list-group-item:hover {
  background-color: var(--bs-light);
}

/* Thicker TOP border for parents except the FIRST parent */
.category-list .list-group-item.is-parent ~ .list-group-item.is-parent {
  border-top: 3px solid #eee !important;
}

/* Keep card bottom corners rounded with flush list */
.card > .list-group:last-child .list-group-item:last-child,
.card-body > .list-group:last-child .list-group-item:last-child {
  border-bottom-left-radius: var(--bs-card-inner-border-radius);
  border-bottom-right-radius: var(--bs-card-inner-border-radius);
}

.list-group-item .label-wrap .bi {
  color: #bbb !important;
}

.count .badge {
  outline: none;
}

.actions-list li:last-child {
    padding-bottom: 0.8rem;
}

/* =======
   Custom HRs
   ======= */
.hr-muted {
  border-top: 2px dotted #7f7f7f !important;
}

/* =======
   Custom Close Button (Modal Header)
   ======= */
.btn-close-custom {
  align-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  height: 2.25rem;
  justify-content: center;
  margin-left: auto;
  padding: 0;
  position: relative;
  transition: transform 0.14s;
  width: 2.25rem;
}

.btn-close-custom:hover {
  transform: scale(1.13) rotate(6deg);
}

.btn-close-custom .bi-circle-fill {
  color: #fb6d6d;
  font-size: 2.2rem;
}

.btn-close-custom .bi-x {
  color: #000;
  font-size: 1.45rem;
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* =======
   Nav Tabs (Fancy Modal Tabs)
   ======= */
.nav-tabs {
  border: none;
  gap: 0.8rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.nav-tabs .nav-link {
  background: #ebf0f1;
  border: 1px solid #ddd;
  border-radius: 0.4rem;
  color: #004c72;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0;
  padding: 0.35rem 1.9rem;
  position: relative;
  transition: color 0.18s, background 0.25s, box-shadow 0.18s;
  outline: none;
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus {
  background: #e6f3fa;
  border: 1px solid #bbb;
  color: #005c87;
}

.nav-tabs .nav-link.active {
  background: linear-gradient(90deg, #1096ce 0%, #0078b0 30%);
  border: 1px solid #07a;
  color: #fff !important;
  /* box-shadow: 0 3px 16px rgba(0,120,176,0.15); */
  z-index: 1;
}

.nav-tabs .nav-link.active::after {
  background: #00d7ff;
  border-radius: 2px;
  bottom: -8px;
  content: "";
  display: block;
  height: 4px;
  left: 40%;
  opacity: 0.9;
  position: absolute;
  width: 20%;
}

.nav-arrow-btn {
  background-color: #69c;
  border: none;
  color: #fff;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0.7rem;
  line-height: 1;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.nav-arrow-btn.disabled,
.nav-arrow-btn.disabled:hover {
    opacity: 0.5;
    background-color: #5183a4;
    transform: scale(1);
}

.nav-arrow-btn i {
  text-shadow: 0 0 1px currentColor; /* adds a subtle weight illusion */
}

.nav-arrow-btn:hover {
  background-color: #69c;
  transform: scale(1.1);
}

.nav-arrow-btn:active {
  transform: scale(0.94);
}

/* =======
   Toggles
   ======= */
.toggle-switch-lg {
  margin-right: 24px;
  transform: scale(1.3);
  transform-origin: left center;
}

.form-check-input.toggle-switch-lg:checked {
  background-color: #00912f;
  border-color: #0a6427;
}

/* =======
   Sortable
   ======= */

.handle { cursor: grab; -webkit-user-drag: none; user-select: none; touch-action: none; }
.handle:active { cursor: grabbing; }

.js-line-drag { cursor: grab; -webkit-user-drag: none; user-select: none; touch-action: none; }
.js-line-drag:active { cursor: grabbing; }

.is-sorting a { pointer-events: none !important; }

.sortable-fallback:not(tr),
.sortable-ghost:not(tr) {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: #fffded;
  border: 0;
  border-radius: 4px;
  box-shadow: inset 0 0 0 4px rgba(230, 165, 90, 0.35);
  height: 48px;
  padding: 0 0.75rem;
  opacity: 0.95;
}

tr.document-line-item-row.sortable-ghost,
tr.document-line-item-row.sortable-fallback {
  display: table-row !important;
}

tr.sortable-ghost,
tr.sortable-fallback {
  display: table-row !important;
}

tr.document-line-item-row.sortable-ghost > td,
tr.document-line-item-row.sortable-fallback > td {
  background: #fffdf0;
}

tr.sortable-ghost > td,
tr.sortable-fallback > td {
  background: #fffdf0;
  box-shadow:
    inset 0 3px 0 rgba(230, 165, 90, 0.38),
    inset 0 -3px 0 rgba(230, 165, 90, 0.38);
}

tr.sortable-ghost > td:first-child,
tr.sortable-fallback > td:first-child {
  box-shadow:
    inset 3px 0 0 rgba(230, 165, 90, 0.38),
    inset 0 3px 0 rgba(230, 165, 90, 0.38),
    inset 0 -3px 0 rgba(230, 165, 90, 0.38);
}

tr.sortable-ghost > td:last-child,
tr.sortable-fallback > td:last-child {
  box-shadow:
    inset -3px 0 0 rgba(230, 165, 90, 0.38),
    inset 0 3px 0 rgba(230, 165, 90, 0.38),
    inset 0 -3px 0 rgba(230, 165, 90, 0.38);
}


.sortable-fallback .cat-row,
.sortable-ghost .cat-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  flex: 1 1 auto;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
}

tr.document-line-item-row {
  transition: transform 300ms ease;
}

.sortable-fallback .label-wrap,
.sortable-ghost .label-wrap {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =======
   Media Queries
   ======= */
/* >= 992px */
@media (min-width: 992px) {
  .th-options-width {
    width: 140px;
  }
}

/* Between 576px and 991.98px */
@media (min-width: 576px) and (max-width: 991.98px) {
  .modal-dialog {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 95vw !important; /* Wide but not edge-to-edge */
  }
}

/* >= 767.99px (note: slightly non-standard breakpoint retained) */
@media (min-width: 767.99px) {
  #toolbar-search {
    max-width: 100%;
    width: 260px;
  }

  .middle-content {
    padding-right: 0.2rem;
  }

  .stock-box {
    min-width: 98px;
  }

  .stock-box-top {
    font-size: 1.25rem;
    padding: 0.3rem 0.9rem;
  }
}

/* <= 767.98px */
@media (max-width: 767.98px) {
  #toolbar-search {
    margin-bottom: 0.75rem;
    margin-right: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  #toolbar-search .form-control,
  #toolbar-search .input-group-text,
  #toolbar-search .btn {
    font-size: 1rem; /* Prevent iOS zoom */
    height: 38px;    /* A nice touch target */
  }

  form#toolbar-search-form {
    width: 100% !important;
  }
}

/* <= 600px */
@media (max-width: 600px) {
  main .row > * {
    padding-left: 0;
    padding-right: 0;
  }

  .inventory-thumb {
    height: 70px;
    margin-right: 0.5rem;
    width: 70px;
  }

  .inventory-thumb-wrapper {
    height: 70px;
    margin: 0.6rem;
    width: 70px;
  }

  .dash-panel-row {
      padding-left: 1rem;
      padding-right: 1rem;
  }
}

/* <= 575.98px */
@media (max-width: 575.98px) {
  header .d-flex.align-items-center > a {
    margin-right: 0.5rem !important;
  }

  header .fs-2 {
    font-size: 1.3rem !important;
  }

  header .rounded-circle {
    height: 38px !important;
    width: 38px !important;
  }

  .modal-item-photo-box {
    height: 100px;
    width: 100px;
  }

  .modal-item-photo-box i {
    font-size: 1.2rem;
    margin-bottom: 0.05rem;
    margin-top: 1rem;
  }

  .modal-item-photo-box small {
    font-size: 0.65rem;
    margin-bottom: 1rem;
  }

  .nav-tabs .nav-link {
    font-size: 1rem;
    padding: 0.4rem 1rem;
  }

  .card table tr th:last-child,
  .card table tr td:last-child {
    padding-right: 0.6rem;
  }

  .modal-form.modal-body {
      padding: 2rem 2.5rem;
  }
}

/* <= 1199.98px */
@media (max-width: 1199.98px) {
  .main-content {
    padding: 1.25rem;
  }

  .main-layout {
    flex-direction: column;
  }

  .sidebar {
    display: none !important;
  }
}

/* =======
   Subscription Widget (v3 Settings Sidebar)
   ======= */
.subscription-widget-price {
  background: linear-gradient(145deg, #f5fbff 0%, #edf6fd 100%);
  border: 1px solid #d8e8f4;
}

.sb-warning-pulse {
  animation: sb-warning-pulse 1.15s ease-in-out 3;
  transform-origin: center;
}

@keyframes sb-warning-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.24);
    transform: scale(1);
  }
  35% {
    box-shadow: 0 0 0 5px rgba(220, 53, 69, 0.08);
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sb-warning-pulse {
    animation: none;
  }
}

.doc-meta-fields-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 220px));
  justify-content: start;
}

.doc-meta-field {
  width: 220px;
}

.doc-meta-field-full {
  grid-column: 1 / -1;
}

@media (max-width: 575.98px) {
  .doc-meta-fields-grid {
    grid-template-columns: 1fr;
  }

  .doc-meta-field {
    width: 100%;
  }
}
