/* ====== STOCK TABLE STYLING ====== */
.stock-table {
  width: 100%;
  border-collapse: collapse;
  border: var(--table-border);
  text-align: center;
  border-radius: var(--border-radius-small);
}

.stock-table th {
  background-color: var(--form-header-background);
  color: white;
  padding: var(--padding-xsmall);
  text-align: center;
  border: var(--table-border);
}

.stock-table td {
  padding: var(--padding-xsmall);
  border: var(--table-border);
  text-align: center;
}

/* ====== CELL PADDING ====== */
.stock-table th,
.stock-table td {
  padding: var(--padding-small);
}

/* ====== COLUMN WIDTHS ====== */
.stock-table th:nth-child(1),
.stock-table td:nth-child(1) {
  width: 30%;
  text-align: left;
}

.stock-table th:nth-child(2),
.stock-table td:nth-child(2) {
  width: 20%;
}

.stock-table th:nth-child(3),
.stock-table td:nth-child(3) {
  width: 15%; /* Expiry Date column */
}

.stock-table th:nth-child(4),
.stock-table td:nth-child(4) {
  width: 20%;
}

.stock-table th:nth-child(5),
.stock-table td:nth-child(5) {
  width: 15%;
}

.stock-table th:nth-child(5),
.stock-table td:nth-child(5) {
  width: 15%;
}

/* warehouse logistics table */
.stock-table.warehouse th:nth-child(1),
.stock-table.warehouse td:nth-child(1) {
  width: 66%;
}

/* ====== EXPIRY DATE COLOUR CODING ====== */
.expiring-warning {
  background-color: #ffa500 !important; /* Orange for < 90 days */
  color: black;
  font-weight: bold;
}

.expiring-soon {
  background-color: #ff6347 !important; /* Red for < 30 days */
  color: white;
  font-weight: bold;
}

/* ====== PRODUCT HEADER STYLING ====== */
.product-header {
  background-color: #d3d3d3 !important;
  font-weight: bold;
  text-align: center;
}

.product-header td {
  text-align: center;
}

/* ====== INPUT FIELD STYLING ====== */

/* Fix batch row alignment */
.batch-row td {
  text-align: center;
  font-weight: bold;
}

.stock-table td.number {
  padding: 0 !important;
}

.quantity {
  position: relative;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield; /* Prevents Firefox's default number controls */
  appearance: textfield; /* Standardizes across browsers */
}

.stock_quantity input {
  width: 62px;
  height: 48px;
  line-height: 1.65;
  float: left;
  display: block;
  padding: 0;
  margin: 0;
  padding-left: 20px;
  border: 1px solid #eee;
  margin: 8px 0;
  font-size: medium;
}

.stock_quantity input:focus {
  outline: 0;
}

.stock_quantity .quantity-nav {
  float: left;
  position: relative;
  height: 48px;
  margin-top: 8px;
}

.stock_quantity .quantity-button {
  position: relative;
  cursor: pointer;
  border-left: 1px solid #eee;
  width: 20px;
  text-align: center;
  color: #333;
  font-size: 13px;
  font-family: "Trebuchet MS", Helvetica, sans-serif !important;
  line-height: 1.7;
  -webkit-transform: translateX(-100%);
  transform: translateX(-100%);
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -o-user-select: none;
  user-select: none;
}

.stock_quantity .quantity-button.quantity-up {
  position: absolute;
  height: 50%;
  top: 0;
  border-bottom: 1px solid #eee;
}

.stock_quantity .quantity-button.quantity-down {
  position: absolute;
  bottom: -1px;
  height: 50%;
}

/* ===== DAWA TABLE ===== */
.dawa-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2em;
  border: var(--table-border);
}

.dawa-table tr {
  background-color: var(--form-header-background);
  color: white;
  padding: var(--padding-xsmall);
  text-align: left;
  border: var(--table-border);
  font-weight: bold;
}

.dawa-table th {
  background-color: var(--form-header-background);
  color: white;
  padding: var(--padding-xsmall);
  text-align: left;
  border: var(--table-border);
  font-weight: bold;
}

.dawa-table td {
  background-color: white;
  color: var(--body-color);
  padding: var(--padding-xsmall);
  text-align: left;
  border: var(--table-border);
  font-weight: 400;
}

.dawa-table td a {
  font-weight: bold;
}

/* ====== PREVIOUS ORDERS TABLE ====== */

/* Style for the main orders table */
.woocommerce-orders-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2em;
  border: var(--table-border);
}

.woocommerce-orders-table .woocommerce-orders-table__header {
  background-color: var(--form-header-background);
  color: white;
  padding: var(--padding-xsmall);
  text-align: left;
  border: var(--table-border);
  font-weight: bold;
}

.woocommerce-orders-table tbody td {
  padding: var(--padding-xsmall);
  border: var(--table-border);
}

.woocommerce-orders-table tbody tr:last-child td {
  border-bottom: none; /* Remove bottom border from the last row */
}

/* Style for order details row */
.woocommerce-orders-table__row.order-details td {
  background-color: #fff; /* White background for order details */
}

/* Style for product sub header row */
.woocommerce-orders-table .sub__header {
  background-color: #eee; /* Slightly lighter grey for product header */
  padding: var(--padding-xsmall);
  border: var(--table-border);
  font-weight: 400;
  font-size: 0.9em;
  text-align: left;
}

/* Style for individual product rows */
.woocommerce-orders-table__row.order-product td {
  background-color: #fff; /* White background for product rows */
  padding: 10px;
  font-size: 0.9em;
}

.woocommerce-orders-table__row {
  border: var(--table-border);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .woocommerce-orders-table thead {
    display: none; /* Hide table header on smaller screens */
  }

  .woocommerce-orders-table tbody tr {
    display: block;
    margin-bottom: 1em;
    border: var(--table-border);
  }

  .woocommerce-orders-table tbody td {
    display: block;
    text-align: right;
    padding-left: 50%;
    position: relative;
    border: var(--table-border);
  }

  .woocommerce-orders-table tbody td:before {
    content: attr(data-title);
    position: absolute;
    left: 6px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8em;
  }

  .woocommerce-orders-table tbody tr.order-products-header th,
  .woocommerce-orders-table tbody tr.order-product td {
    display: block;
    text-align: right;
    padding-left: 50%;
    position: relative;
    border: var(--table-border);
  }

  .woocommerce-orders-table tbody tr.order-products-header th:before,
  .woocommerce-orders-table tbody tr.order-product td:before {
    content: attr(data-title);
    position: absolute;
    left: 6px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8em;
  }

  .woocommerce-orders-table tbody tr.order-products-header th:last-child,
  .woocommerce-orders-table tbody tr.order-product td:last-child {
    border: var(--table-border);
  }
}
.admin_section_wrapper .order-filters {
  color: #666;
}

.admin_section_wrapper .order-filters a {
  font-size: 0.8em;
  text-decoration: none;
  color: var(--button-bg-color);
}

.admin_section_wrapper .order-filters a.current {
  color: var(--button-submit-bg-color);
  font-weight: 600;
}
