body {
  font-size: .875rem;
}

/* body::-webkit-scrollbar { width: 0 !important } */
.sidebar-sticky::-webkit-scrollbar {
  width: 5px;
}
.sidebar-sticky::-webkit-scrollbar-track {
  background: #eee;
}
.sidebar-sticky::-webkit-scrollbar-thumb {
  background-color: #e83e8c;
}
  
.feather {
  width: 16px;
  height: 16px;
  vertical-align: text-bottom;
}

/*
  * Sidebar
  */
#sidebarMenu {
  background-color: #fff;
}
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100; /* Behind the navbar */
  /* padding: 48px 0 0; Height of navbar */
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
  
}

@media (max-width: 767.98px) {
  .sidebar {
    top: 5rem;
  }
}

.sidebar-sticky {
  position: relative;
  top: 0;
  height: calc(100vh - 48px);
  padding-top: .5rem;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

@supports ((position: -webkit-sticky) or (position: sticky)) {
  .sidebar-sticky {
    position: -webkit-sticky;
    position: sticky;
  }
}

.sidebar .nav-link {
  font-weight: 500;
  color: #333;
  margin-left: 12px;
}

.sidebar .nav-link:hover {
  font-weight: bold;
  color: #e83e8c;
}

.sidebar .nav-link .feather {
  margin-right: 4px;
  color: #999;
}

.sidebar .nav-link.active {
  /* color: #007bff; */
  color: #e83e8c;
  font-weight: bold;
}

.sidebar .nav-link:hover .feather,
.sidebar .nav-link.active .feather {
  color: inherit;
}

.sidebar-heading {
  font-size: .75rem;
  text-transform: uppercase;
}

/*
  * Navbar
  */

.navbar-brand {
  padding-top: .75rem;
  padding-bottom: .75rem;
  font-size: 1rem;
  color: #e83e8c;
}

.app-navbar {
  min-height: 56px;
  z-index: 1031;
}

.app-brand {
  font-weight: 700;
  color: #e83e8c !important;
}

.app-page-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.sidebar-logout {
  color: #dc3545 !important;
  font-weight: 600;
}

.sidebar-logout:hover {
  color: #a71d2a !important;
}

.sidebar-footer {
  margin-top: auto;
}

.navbar .navbar-toggler {
  top: .25rem;
  right: 1rem;
}

.navbar .form-control {
  padding: .75rem 1rem;
  border-width: 0;
  border-radius: 0;
}

.navbar ul {
  list-style: none;
}

.form-control-dark {
  color: #fff;
  background-color: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .1);
}

.form-control-dark:focus {
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .25);
}

.qty-minus, .qty-plus {
  border: none;
  color: #fff;
}
.qty-minus {
  background-color: #dc3545;
}
.qty-plus {
  background-color: #28a745;
}

.qty-number, #paid_amount_input {
  width: 48px;
  padding: 0 5px;
  border: 1px solid #ced4da;
  color: #495057;
  text-align: center;
}

.pos-num-input,
.price-input,
.qty-number,
.qty-gauze-input,
#paid_amount_input,
#mobile_paid_amount_input,
#phone_input,
#customer_mobile {
  font-variant-numeric: tabular-nums;
}

.price-input {
  width: 80px;
}

#paid_amount_input {
  width: 96px;
  text-align: left;
}

#mobile_search_result ul {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid #DCDCDC;
}

#mobile_search_result ul li {
  padding: 4px;
  cursor: pointer;
  border-bottom: 1px solid #DCDCDC;
}

#mobile_search_result ul li:hover {
  font-weight: bold;
}
  
.qty-gauze-input, .qty-gauze-input-disabled {
  width: 64px;
  padding: 12px 5px;
  border: 1px solid #ced4da;
  color: #495057;
  height: 24px;
}

.qty-gauze-input:focus {
  outline: none;
  border: 1px solid #555;
}

.qty-gauze-input-disabled {
  width: 48px;
  text-align: center;
  margin: 0;
  background-color: #e9ecef;
}

.qty-gauze-input-disabled:focus {
  outline: none;
}

.qty-gauze-input-container .qty {
  margin-left: 2px;
  color: #4f5f6f;
}

/* POS mobile-friendly layout */
.pos-page {
  padding-bottom: 5.5rem;
}

.pos-search-wrap {
  position: relative;
}

#search_result {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  background: #fff;
  max-height: 50vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-radius: 0 0 8px 8px;
}

#search_result ul,
#search_result .search_result_list {
  list-style: none;
  margin: 0;
  padding: 0;
}

#search_result li,
#search_result .search_result_list {
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid #e9ecef;
  font-size: 0.95rem;
  line-height: 1.35;
}

#search_result li:hover,
#search_result .search_result_list:hover {
  background: #f8f9fa;
  font-weight: 600;
}

.pos-products-sidebar {
  border-radius: 8px;
  overflow: hidden;
}

.pos-products-title {
  font-size: 1.1rem;
  border-bottom: 1px solid #eee;
}

.pos-products-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  max-height: 42vh;
  overflow-y: auto;
}

@media (min-width: 768px) {
  .pos-products-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-height: 36vh;
  }
}

@media (min-width: 992px) {
  .pos-page {
    padding-bottom: 0;
  }

  .pos-cart-form {
    max-width: 100%;
  }

  .pos-products-panel {
    margin-top: 0;
  }

  .pos-products-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    max-height: 32vh;
    gap: 10px;
    padding: 16px;
  }

  .pos-product-btn {
    min-height: 48px;
    font-size: 0.9rem;
  }
}

@media (min-width: 1200px) {
  .pos-products-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (min-width: 1400px) {
  .pos-products-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

.pos-product-btn {
  white-space: normal;
  text-align: left;
  min-height: 52px;
  line-height: 1.25;
  padding: 10px 12px;
  font-size: 0.85rem;
}

.pos-summary-card {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
}

.pos-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.pos-summary-row + .pos-summary-row {
  border-top: 1px solid #e9ecef;
}

.pos-paid-input {
  max-width: 120px;
  text-align: right;
}

.pos-checkout-wrap {
  margin-top: 12px;
}

.pos-checkout-btn {
  min-height: 48px;
  font-size: 1.05rem;
  font-weight: 600;
}

.pos-product-cell {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  white-space: normal;
}

.pos-product-name {
  flex: 1 1 auto;
  display: block;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.35;
  overflow: visible;
}

.pos-cart-table th:first-child,
.pos-cart-table td.pos-product-cell {
  width: 42%;
  min-width: 140px;
}

@media (min-width: 768px) {
  .pos-table-wrap.table-responsive {
    overflow-x: visible;
  }

  .pos-cart-table {
    table-layout: fixed;
    width: 100%;
  }

  .pos-cart-table th:first-child,
  .pos-cart-table td.pos-product-cell {
    width: 55%;
    min-width: 320px;
  }

  .pos-cart-table th:nth-child(2),
  .pos-cart-table td.price {
    width: 14%;
  }

  .pos-cart-table th:nth-child(3),
  .pos-cart-table td.quantity {
    width: 17%;
  }

  .pos-cart-table th:nth-child(4),
  .pos-cart-table td.subtotal {
    width: 14%;
  }

  .pos-cart-table .price-input {
    width: 100%;
    max-width: 140px;
  }

  .pos-cart-table .pos-product-name {
    font-size: 0.98rem;
    padding-right: 8px;
  }
}

@media (min-width: 1200px) {
  .pos-cart-table th:first-child,
  .pos-cart-table td.pos-product-cell {
    width: 62%;
    min-width: 420px;
  }

  .pos-cart-table th:nth-child(2),
  .pos-cart-table td.price {
    width: 12%;
  }

  .pos-cart-table th:nth-child(3),
  .pos-cart-table td.quantity {
    width: 14%;
  }

  .pos-cart-table th:nth-child(4),
  .pos-cart-table td.subtotal {
    width: 12%;
  }
}

.pos-delete-btn {
  flex-shrink: 0;
  padding: 2px 8px;
  line-height: 1.2;
}

@media (max-width: 767.98px) {
  #app_container {
    margin-top: 0 !important;
    padding-left: 0;
    padding-right: 0;
  }

  .pos-page {
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 7rem;
  }

  .pos-cart-form {
    border-radius: 0;
    padding-bottom: 1rem;
  }

  .pos-search-input,
  #datepicker {
    font-size: 16px;
  }

  .pos-num-input,
  .price-input,
  .qty-number,
  .qty-gauze-input,
  #paid_amount_input,
  #mobile_paid_amount_input,
  #phone_input,
  #customer_mobile {
    font-size: 16px;
  }

  .pos-table-wrap {
    overflow: visible;
  }

  .pos-table-wrap.table-responsive {
    overflow-x: visible;
    overflow-y: visible;
  }

  .pos-cart-table thead {
    display: none;
  }

  .pos-cart-table tfoot {
    display: none !important;
  }

  .pos-cart-table tbody tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  }

  .pos-cart-table tbody td {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    border: none;
    padding: 0;
    text-align: center;
    min-width: 0;
  }

  .pos-cart-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6c757d;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    width: 100%;
    text-align: center;
  }

  .pos-cart-table tbody td[data-label="Product"] {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.35;
    padding-bottom: 10px;
    margin-bottom: 2px;
    border-bottom: 1px solid #f1f3f5;
    overflow: visible;
    min-height: auto;
    width: 100%;
  }

  .pos-cart-table tbody td[data-label="Product"]::before {
    display: none;
  }

  .pos-cart-table .pos-product-name {
    flex: 1 1 auto;
    display: block;
    overflow: visible;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.35;
  }

  .pos-cart-table .price-input {
    width: 100%;
    max-width: none;
    min-height: 36px;
    font-size: 15px;
    padding: 4px 6px;
    text-align: center;
  }

  .pos-cart-table .qty-number,
  .pos-cart-table .qty-gauze-input,
  .pos-cart-table .qty-gauze-input-disabled {
    min-height: 34px;
    font-size: 15px;
    width: 40px;
    padding: 4px;
  }

  .pos-cart-table .qty-gauze-input-disabled {
    width: 34px;
  }

  .qty-minus,
  .qty-plus {
    min-width: 32px;
    min-height: 32px;
    font-size: 1rem;
    border-radius: 6px;
    padding: 0;
  }

  .pos-cart-table tbody td.price,
  .pos-cart-table tbody td.quantity,
  .pos-cart-table tbody td.subtotal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
  }

  .pos-cart-table .price-input,
  .pos-cart-table .qty-controls-row,
  .pos-cart-table .subtotal-amount {
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
  }

  .pos-cart-table .qty-field-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }

  .pos-cart-table .qty-controls-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
  }

  .pos-cart-table .qty-gauze-input-container {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }

  .pos-cart-table .qty {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 0;
    font-size: 0.7rem;
    line-height: 1.2;
    color: #6c757d;
  }

  .pos-cart-table tbody td.subtotal {
    font-weight: 700;
    font-size: 1rem;
  }

  .pos-cart-table .subtotal-amount {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
  }

  .pos-checkout-wrap {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  }

  .pos-checkout-btn {
    margin-bottom: 0;
  }

  .pos-products-panel.collapse:not(.show) {
    display: none;
  }

  .pos-products-panel.collapse.show,
  .pos-products-panel.collapsing {
    display: block;
  }
}

/* Products list page */
.products-page h2 {
  font-size: 1.35rem;
}

.products-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.products-table .product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.products-total {
  font-size: 1rem;
}

@media (max-width: 767.98px) {
  .products-page {
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
  }

  .products-search-form .input-group {
    flex-wrap: nowrap;
  }

  .products-search-form .form-control {
    font-size: 16px;
    min-width: 0;
  }

  .products-table-wrap {
    overflow: visible;
  }

  .products-table thead {
    display: none;
  }

  .products-table,
  .products-table tbody,
  .products-table tr,
  .products-table td {
    display: block;
    width: 100%;
  }

  .products-table tbody tr {
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  }

  .products-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    border: none;
    border-bottom: 1px solid #f1f3f5;
    padding: 8px 0;
    text-align: right;
  }

  .products-table tbody td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .products-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6c757d;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-align: left;
    flex-shrink: 0;
  }

  .products-table tbody td.product-name-cell {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.35;
    padding-top: 0;
    padding-bottom: 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid #e9ecef;
  }

  .products-table tbody td.product-name-cell::before {
    margin-bottom: 4px;
  }

  .products-table tbody td.product-actions-cell {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 10px;
  }

  .products-table .product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .products-table .product-actions .btn {
    width: 100%;
    min-height: 38px;
    font-size: 0.85rem;
  }

  .products-total {
    font-size: 0.95rem;
  }
}

/* Add / Edit product form */
.product-form-page h3,
.product-form-title {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
}

.product-header-row .form-control {
  min-width: 0;
}

.product-unit-radios .form-check-inline {
  margin-right: 10px;
}

@media (max-width: 767.98px) {
  .product-form-page .form-control {
    font-size: 16px;
  }

  .product-form-page label {
    font-size: 0.82rem;
    margin-bottom: 4px;
  }

  .product-unit-radios {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .product-unit-radios .form-check-inline {
    margin-right: 0;
  }

  .product-form-page .btn-block {
    min-height: 44px;
  }
}

@media (min-width: 768px) {
  .product-form-page .btn-md-auto {
    width: auto;
    display: inline-block;
  }
}
