body {
  /* Default padding for most screens for header */
  background: #f8f8ff;
  color: #333333;
  height: 100%;
  min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #444444;
}

main.container {
  width: 100% !important;
}

.yellow-icon {
  color: #fed800;
}

.yellow-tooltip {
  --bs-tooltip-bg: #fed800;
}

.yellow-tooltip > .tooltip-inner {
  padding: 3px 8px;
  color: black;
  text-align: center;
  background-color: #fed800;
  border-radius: 0.25rem;
}

.table .thead-light th {
  white-space: nowrap;
  background-color: #0f3363;
  color: white !important;
}

.table .thead-primary th {
  white-space: nowrap;
  background-color: var(--bs-primary-bg-subtle) !important;
}

.table .thead-orange th {
  white-space: nowrap;
  background-color: var(--bs-warning-bg-subtle) !important;
}

.table thead th small {
  font-weight: bold;
}

.content-section {
  background: #ffffff;
  padding: 10px 20px;
  border: 1px solid #dddddd;
  border-radius: 3px;
  margin-bottom: 20px;
}

.bootstrap-table .fixed-table-container .fixed-table-body {
  border-top-left-radius: 12px;
  margin-bottom: 70px;
}
.table-section {
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  font-size: smaller;
}

.article-title {
  color: #444444;
}

a.article-title:hover {
  color: #428bca;
  text-decoration: none;
}

.article-content {
  white-space: pre-line;
}

.article-img {
  height: 65px;
  width: 65px;
  margin-right: 16px;
}

.article-metadata {
  padding-bottom: 1px;
  margin-bottom: 4px;
  border-bottom: 1px solid #e3e3e3;
}

.article-metadata a:hover {
  color: #333;
  text-decoration: none;
}

.article-svg {
  width: 25px;
  height: 25px;
  vertical-align: middle;
}

.account-img {
  height: 125px;
  width: 125px;
  margin-right: 20px;
  margin-bottom: 16px;
}

.account-heading {
  font-size: 2.5rem;
}

.hide {
  display: none;
}

#loadingText {
  text-align: center;
  padding: 2%;
  color: #2fa4e7;
  font-size: large;
}

#loading {
  margin: auto;
  border: 16px solid #f3f3f3;
  /* Light grey */
  border-top: 16px solid #93d0f3;
  /* Blue */
  border-radius: 50%;
  width: 80px;
  height: 80px;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}
.fixed-bottom {
  bottom: 20px;
}
.tableFixHead {
  overflow: auto;
  width: 100%;
}

.tableFixHead thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.clickable a {
  color: white;
  text-decoration: underline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  width: auto;
}

.clickable a:hover {
  color: #00008b !important;
  text-decoration: underline;
}

.text-danger {
  color: red;
}

.text-warning {
  color: orange;
}

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

.high-fraud {
  border: 2px solid red;
  color: red;
}

.medium-fraud {
  border: 2px solid orange;
  color: orange;
}

@media (max-width: 767px) {
  .clickable a {
    max-width: 150px;
  }
}

@media (min-width: 768px) {
  .clickable a {
    max-width: 300px;
  }
}

.text-nowrap {
  white-space: nowrap;
}

.overflow-hidden {
  overflow: hidden;
}

.text-truncate {
  text-overflow: ellipsis;
  overflow: hidden;
  vertical-align: text-top;
}

.toggle {
  border-radius: 10px !important;
  /* Rounds the entire toggle */
}

.toggle-group {
  border-radius: 10px !important;
  /* Rounds the inside toggle switch */
}

.toggle-handle {
  border-radius: 10px !important;
  /* Rounds the toggle handle */
}

.suppliers-card-header {
  background-color: #003459;
  padding: 15px;
  border-radius: 5px 5px 0 0;
}

.suppliers-card-header h5 {
  color: white;
}

.contacts-card-header {
  background-color: rgb(0, 64, 221);
}

.contacts-card-header h5 {
  color: white;
}

.banks-card-header {
  background-color: rgb(255, 69, 58);
}

.banks-card-header h5 {
  color: white;
}

.inline-input {
  width: auto;
  font-size: inherit;
  vertical-align: center;
  display: inline-block;
  font-size: 2.5rem;
}

.profile-circle {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #007bff;
  color: white;
  text-align: center;
  line-height: 20px;
  font-size: 15px;
  font-weight: bold;
}

.bg-soft-primary {
  background-color: #007bff;
  color: white;
  font-weight: bold;
}

.bg-soft-secondary {
  background-color: #6c757d;
  color: white;
}

.overview-header {
  background-color: #00171f;
}

.overview-header h4 {
  color: white;
}

hr {
  opacity: 10%;
}

.grad {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 50%,
    rgba(255, 255, 0, 1) 50%,
    rgba(255, 255, 0, 1) 100%
  );
  color: #000;
  border: none;
  box-shadow: none;
  /* Remove any default Bootstrap shadow */
  padding: 5px 10px;
  text-decoration: none;
}

.normal-link {
  color: #007bff;
  text-decoration: none;
  /* Remove underline */
  padding: 5px 10px;
}

.normal-link:hover,
.normal-link:focus {
  text-decoration: underline;
  color: #0056b3;
}

/*======================
    404 page
=======================*/

.page_404 {
  height: calc(100vh - 100px);
  /* Adjust 100px if there is a header or other content above */
  background: #fff;
  font-family: "Arvo", serif;
}

.error-title {
  font-size: 8rem;
  /* Adjust size as needed */
  font-weight: bold;
  color: #333;
  margin-bottom: 20px;
  /* Add some space below the title */
}

.four_zero_four_bg {
  background-image: url("/static/gif/404.gif");
  height: 400px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.table-purchase td,
.table-purchase th {
  position: relative;
  /* Ensure table cells are not absolutely or fixed positioned */
}

.bg-light-green {
  background-color: #d4edda;
  color: #155724;
}

.bg-light-red {
  background-color: #f8d7da;
  color: #721c24;
}

.bg-light-grey {
  background-color: #d6d8d9;
  /* Light grey background */
  color: #343a40;
  /* Dark grey text */
}

.bg-yellow-contrast {
  background-color: #f09c00;
  color: #ffffff;
}

.bg-yellow {
  --bs-bg-opacity: 1;
  --bs-yellow-rgb: 255, 193, 7;
  background-color: rgba(var(--bs-yellow-rgb), var(--bs-bg-opacity)) !important;
  color: #212529;
}

.bento-container {
  display: flex;
  flex-wrap: wrap; /* Allows wrapping to the next line */
  justify-content: center;
  padding: 20px;
  gap: 16px; /* Adds spacing without expanding box dimensions */
}

.bento-box {
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  max-width: 600px; /* Sets a max width */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  flex: 1 1 280px; /* Allows boxes to shrink for better fit */
}

.bento-box-contact-support {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 1px;
}
.bento-box-contact-support select,
.bento-box-contact-support button {
  white-space: nowrap; /* Prevent text wrapping inside elements */
}

.notes-textarea {
  background-color: #fdfdaa;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
  resize: vertical;
  width: 100%;
  height: 200px;
  font-size: 0.9rem;
  font-family: Arial, sans-serif;
  line-height: 1.5;
  color: #333;
}

.notes-history-btn {
  float: right;
  margin-top: 10px;
}
.item-header {
  font-size: 2rem;
  color: blue;
  font-weight: bold;
}
.status-select {
  width: 120px;
}
.status-shipped {
  background-color: #28a745;
  color: white;
}
.status-cancelled {
  background-color: #dc3545;
  color: white;
}
.status-processing {
  background-color: #ffc107;
  color: black;
}
.status-need-contact {
  background-color: #ff5733;
  color: white;
}
.add-supplier-btn {
  background-color: blue;
  color: white;
}

.order-line-items-container {
  width: 100%;
  padding: 20px 0;
  background-color: white;
}

.order-line-item {
  width: 100%;
  background-color: transparent;
  margin-bottom: 20px;
}

.order-line-item table {
  margin-top: 10cpx;
}

.blurred {
  filter: blur(2px);
  opacity: 0.5;
  pointer-events: none; /* Prevent interactions */
}

.disabled-button {
  pointer-events: none; /* Prevent clicking */
  opacity: 0.5; /* Visual indication of disabled state */
}

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

/* Sticky Table Header */
.thead-light th {
  position: sticky; /* Makes the header sticky */
  top: 0; /* Sticks the header to the top */
  z-index: 10; /* Ensures it stays above the table body */
  background-color: #f8f9fa; /* Solid background for header */
  border-bottom: 2px solid #dee2e6; /* Optional: distinct border */
}
.thead-lighter th {
  position: sticky; /* Makes the header sticky */
  top: 0; /* Sticks the header to the top */
  z-index: 10; /* Ensures it stays above the table body */
  background-color: #6b81b2; /* Solid background for header */
  border-bottom: 2px solid #dee2e6; /* Optional: distinct border */
}
.table-responsive {
  display: block;
  overflow-x: auto; /* Allow horizontal scrolling for table */
  width: 100%; /* Ensure table takes up full container width */
}

.order-line-item {
  position: relative;
  overflow-y: auto; /* Enable vertical scrolling for the whole container if needed */
  padding: 10px; /* Optional padding for better layout */
}

.table-scrollable th:not(:first-child),
.table-scrollable td:not(:first-child) {
  min-width: 150px;
}

/* style for table to make it rounded (apply on table's container) */
.table-rounded {
  border-radius: 0.5rem;
  border-collapse: separate;
  border-spacing: 0;
}

.table-round-top-left {
  border-radius: 0.5rem;
}
/* Default style for status and quantity labels */

/* Style when in stock */
.in-stock,
.unshipped {
  color: red;
  font-size: 1.2rem;
  font-weight: bold;
}

/* Style when delivered */
.delivered,
.shipped {
  color: #0432ff;
  font-size: 1.2rem;
  font-weight: bold;
}

/* Stype when in Reserved */
.in-available {
  color: #cccccc;
  font-size: 1.2rem;
  font-weight: bold;
}

.highlight-red {
  background-color: red !important; /* Light red background */
  color: white !important; /* Red text */
  font-weight: bold;
}

.grouped-row > td {
  background-color: #d6d8db;
  font-weight: bold;
}

.bg-orange {
  background-color: var(--bs-orange);
  color: white;
}

.right-column,
.table-scrollable {
  min-height: 300px;
}
/* Ensure Select2 containers expand correctly inside table cells */
.select2-container {
  width: 100% !important;
  max-width: none !important;
}

.select2-selection--multiple {
  white-space: normal !important;
  overflow-x: visible !important;
  border: 1px solid #ced4da !important;
}

.select2-selection__choice {
  background-color: #e9ecef !important;
  border: 1px solid #ced4da !important;
}

.select2-container--default.select2-container--disabled
  .select2-selection--multiple {
  background-color: #e9ecef !important;
}

.quantity-warning {
  position: absolute;
  background-color: #ffffff;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sticky-footer-toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1029;
  background: #fcfcfc;
  border-top: 1px solid #dee2e6;
  padding: 10px 20px;
  padding-left: 100px;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
}
.footer-toolbar-spacer {
  height: 80px;
}

/* For button spinner with htmx */
/* When HTMX sets .htmx-request on the spinner, show it */
#spinner.htmx-request {
  display: inline-block !important;
}

/* Optional: Hide the label when spinner is active */
button:has(#spinner.htmx-request) .btn-label {
  display: none;
}

.nav-tabs .nav-link {
  background-color: lightgray;
  color: black;
}
.nav-tabs > .nav-link:not(:last-child) {
  margin-right: 5px;
}
#ship article,
#return article {
  border-top: none;
}

#toast-frame {
  background-color: #ffffff;
  max-height: calc(100vh - 20px);
}
#toast-head {
  height: 100%;
}
#toast-container {
  margin: 10px;
  max-height: 50vh;
  overflow: auto;
}
#toast-mini {
  position: fixed;
  top: calc(50vh - 20px);
  right: 20px;
  z-index: 1060;
  display: none;
}

.select2-container.select2-container--default.select2-container--open {
  z-index: 1060;
}

.domain-badge {
  color: #333;
  font-weight: 500;
  border-radius: 0.5rem;
}
.domain-purchasing {
  background-color: #f4e3d3;
}
.domain-shipping {
  background-color: #f4adb3;
}
.domain-inventory {
  background-color: #94c5cc;
}
.domain-product {
  background-color: #adb7c0;
}
.domain-sale {
  background-color: #eebcb1;
}
.domain-customer {
  background-color: #ecd89d;
}
.domain-store {
  background-color: #6fe55f;
}

.role-member {
  background-color: #ae93be;
}
.role-senior {
  background-color: #5c5992;
}
.role-manager {
  background-color: #403369;
}

.dropdown-toggle-up::after {
  border-bottom: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-left: 0.3em solid transparent;
  border-top: 0;
}

label[required]:after {
  content: " *";
  color: red;
}

[x-cloak] {
  display: none !important;
}

.tooltip-inner {
  white-space: pre-line;
}

a[disabled] {
  pointer-events: none;
  opacity: 0.5;
}

#toast-wrapper {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1060;

  width: fit-content;
  height: fit-content;

  visibility: hidden;
}

#toast-wrapper.visible {
  visibility: visible;
  pointer-events: auto;
}

#toast-frame {
  transform: scale(0);
  transform-origin: right bottom;
  opacity: 0;
  visibility: hidden;

  transition:
    transform 0.1s ease,
    opacity 0.1s ease,
    visibility 0.1s;
}

#toast-frame.visible {
  transform: scale(1);
  opacity: 1;
  visibility: visible;
}

#toast-container .toast.show {
  animation: toast-enter 0.1s ease both;
  transform-origin: center bottom;
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.85);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
