/* ====== GLOBAL TABLE WRAPPER ====== */
.table-wrapper {
  overflow-x: auto;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 2em;
}

/* ====== SHIP ORDER CELL STYLING ====== */
.ship-order-cell {
  background: #e3f2fd !important;
  font-weight: 600;
}

.ship-order-cell a {
  color: #005a87;
  text-decoration: none;
  font-weight: 600;
}

.ship-order-cell a:hover {
  text-decoration: underline;
  color: #003d5c;
}

/* ====== STOCK TABLE STYLING ====== */
.stock-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.stock-table th {
  background: #f0f0f1;
  color: #333;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid #005a87;
  position: sticky;
  top: 0;
}

.stock-table td {
  padding: 12px;
  border-bottom: 1px solid #ddd;
  text-align: left;
  font-size: 13px;
}

.stock-table tbody tr:nth-child(even) {
  background: #fffbea;
}

.stock-table tbody tr:hover {
  background: #f5f5f5;
}

/* Lighter background for batch rows with better contrast */
.stock-table .product-batch-row {
  background: #fff !important;
}

/* Even batch rows within each product group (resets per product) */
.stock-table .product-batch-row.batch-row-even {
  background: #fffbea !important;
}

/* Odd batch rows within each product group */
.stock-table .product-batch-row.batch-row-odd {
  background: #fff !important;
}

.stock-table .product-batch-row td {
  border-bottom: 1px solid #e0e0e0 !important;
}

/* ====== 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: #545353;
  font-weight: bold;
}

/* ====== PRODUCT HEADER STYLING ====== */
.product-header {
  background-color: #e3f2fd !important;
  font-weight: bold;
  text-align: center;
  border-bottom: 1px solid #b3d9f7 !important;
}

.product-header td {
  text-align: center;
  border-bottom: 1px solid #b3d9f7 !important;
}

/* ====== 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;
  background: #fff;
}

.dawa-table th {
  background: #f0f0f1;
  color: #333;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid #005a87;
  position: sticky;
  top: 0;
}

.dawa-table td {
  background-color: white;
  color: var(--body-color);
  padding: 12px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid #ddd;
}

.dawa-table tbody tr:nth-child(even) {
  background: #f9f9f9;
}

.dawa-table tbody tr:hover {
  background: #f0f0f0;
}

.dawa-table td a {
  font-weight: 600;
  color: var(--button-bg-color);
  text-decoration: none;
}

.dawa-table td a:hover {
  text-decoration: underline;
}

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

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

.woocommerce-orders-table .woocommerce-orders-table__header {
  background: #005a87;
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
}

.woocommerce-orders-table tbody td {
  padding: 12px;
  border-bottom: 1px solid #ddd;
  font-size: 13px;
}

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

/* Style for product sub header row */
.woocommerce-orders-table .sub__header {
  background: #f0f0f1;
  color: #333;
  padding: 12px;
  font-weight: 600;
  font-size: 13px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

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

.woocommerce-orders-table tbody tr:nth-child(even) .order-product td {
  background: #f9f9f9;
}

.woocommerce-orders-table tbody tr:hover .order-product td {
  background: #f0f0f0;
}

/* 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;
}

/* ====== PROFESSIONAL TABLE STYLING STANDARDS ====== */
/*
 * All tables in the app follow these consistent design principles:
 *
 * HEADERS:
 * - Background: #f0f0f1 (light gray)
 * - Color: #333
 * - Padding: 12px
 * - Font-weight: 600
 * - Font-size: 14px
 * - Border-bottom: 1px solid #005a87 (brand blue)
 * - Position: sticky (for scroll tables)
 *
 * CELLS:
 * - Padding: 12px
 * - Font-size: 13px
 * - Border-bottom: 1px solid #ddd
 * - Text-align: left
 *
 * ROWS:
 * - Zebra striping: tr:nth-child(even) { background: #f9f9f9; }
 * - Hover: tr:hover { background: #f0f0f0; }
 *
 * WRAPPER (optional):
 * - Use .table-wrapper class for overflow-x: auto
 * - Background: #fff
 * - Border: 1px solid #ddd
 * - Border-radius: 4px
 *
 * EXCEPTIONS:
 * - Order tables use brand blue (#005a87) header for main order info
 * - Sub-headers use light gray (#f0f0f1) styling
 */

/* ====== PAGINATION STYLING ====== */
.tablenav {
  clear: both;
  margin: 20px 0;
  padding: 10px 0;
}

.tablenav.top {
  margin-bottom: 20px;
  border-bottom: 1px solid #ddd;
}

.tablenav.bottom {
  margin-top: 20px;
  border-top: 1px solid #ddd;
}

.tablenav-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.displaying-num {
  font-size: 14px;
  color: #333;
  font-weight: 700;
  margin-right: 10px;
}

.dawa-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 28px;
  padding: 4px 10px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background-color: #0073aa;
  border: 2px solid #0073aa;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 115, 170, 0.2);
  line-height: 1;
}

.pagination-btn:hover {
  background-color: #005a87;
  border-color: #005a87;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
}

.pagination-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 115, 170, 0.2);
}

.pagination-btn.disabled {
  background-color: #e0e0e0;
  border-color: #d0d0d0;
  color: #999;
  cursor: not-allowed;
  box-shadow: none;
}

.pagination-btn.disabled:hover {
  background-color: #e0e0e0;
  border-color: #d0d0d0;
  transform: none;
  box-shadow: none;
}

/* Different colors for different buttons */
.pagination-btn.first-page,
.pagination-btn.last-page {
  background-color: #2271b1;
  border-color: #2271b1;
}

.pagination-btn.first-page:hover,
.pagination-btn.last-page:hover {
  background-color: #135e96;
  border-color: #135e96;
}

.pagination-btn.prev-page {
  background-color: #00a0d2;
  border-color: #00a0d2;
}

.pagination-btn.prev-page:hover {
  background-color: #0087be;
  border-color: #0087be;
}

.pagination-btn.next-page {
  background-color: #00a0d2;
  border-color: #00a0d2;
}

.pagination-btn.next-page:hover {
  background-color: #0087be;
  border-color: #0087be;
}

.paging-input {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  background-color: #f7f7f7;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin: 0 8px;
  box-sizing: border-box;
}

.paging-input .page-numbers {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  line-height: 1;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .tablenav-pages {
    flex-direction: column;
    gap: 10px;
  }

  .dawa-pagination {
    gap: 5px;
  }

  .pagination-btn {
    min-width: 32px;
    height: 28px;
    padding: 4px 8px;
    font-size: 14px;
  }

  .paging-input {
    height: 28px;
    padding: 0 8px;
  }

  .paging-input .page-numbers {
    font-size: 11px;
  }

  .displaying-num {
    font-size: 13px;
    font-weight: 700;
    margin-right: 0;
  }
}
