/* Reset and foundation */
:root {
  --primary-color: #2e7d32;      /* Deep green for primary actions/elements */
  --primary-lightlight:  #e6f9e7;
  --primary-light: #a5d6a7;      /* Light green for highlights/backgrounds */
  --primary-dark: #1b5e20;       /* Dark green for hover states */
  --accent-color: #ff8f00;       /* Amber for accents/secondary elements */
  --success-color: #388e3c;      /* Green for success states */
  --warning-color: #f57c00;      /* Orange for warnings */
  --danger-color: #d32f2f;       /* Red for errors/dangers */
  --red:  #c73232;
  --red-light:  #f7e7e7;
  --gray-light: #f5f5f5;         /* Light gray for backgrounds */
  --gray-medium: #e0e0e0;        /* Medium gray for borders */
  --gray-semi:  #dfdfdf;
  --gray-dark: #757575;          /* Dark gray for text */
  --box-shadow: 0 2px 5px rgba(0,0,0,0.1);  /* Consistent shadow */
  --border-radius: 4px;          /* Consistent border radius */
}

/* Basic layout and typography */


.section-header {
  margin: 10px 0 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-light);
  font-weight: 600;
  font-size: 18px;
  color: var(--primary-dark);
}

.section-header-sm {
  margin: 7px 0 12px;
  padding-bottom: 7px;
 /* border-bottom: 2px solid var(--primary-light);*/
  font-weight: 600;
  font-size: 16px;
  color: var(--primary-dark);
}

/* Tabs styling - keeping the existing structure */
.orders-tabs {
  margin-bottom: 20px;
}

.tabs {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  border: none;
}

.tab-link {
  padding: 10px 15px;
  cursor: pointer;
  margin-right: 5px;
  border-bottom: none;
  border-radius: 4px;
  transition: all 0.2s ease;
  color: #555;
}

.tab-link:hover:not(.current) {
  background-color: rgba(165, 214, 167, 0.1);
  color: var(--primary-dark);
}

.tab-link.current {
  border-color: var(--primary-light);
  font-weight: bold;
  color: var(--primary-dark);
  background: var(--primary-lightlight);
}

.tab-pane {
  display: none;
  padding: 11px 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tab-pane.current {
  display: block;
  opacity: 1;
}

/* Table styling - enhanced but compatible */
.orders-table, .customers-table, .batch-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
}

.orders-table th, .customers-table th, .batch-table th {
  /*background-color: var(--primary-light);*/
  color: var(--primary-dark);
  font-weight: bold;
  padding: 7px 8px;
  font-size: 14px;
}

.orders-table td, .customers-table td, .batch-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #ddd;
  text-align: left;
  font-size: 14px;
}

/* Alternating row colors */
.orders-table tbody tr:nth-child(even):not(.delivery-date-header),
.customers-table tbody tr:nth-child(even),
.batch-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.orders-table tbody tr:hover:not(.delivery-date-header),
.customers-table tbody tr:hover,
.batch-table tbody tr:hover {
  background-color: rgba(165, 214, 167, 0.1);
}

.order-header,
.order-allocation-summary {
  margin-bottom: 7px;
}

/* Action bar styling */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 10px;
  background-color: #fafafa;
  border-radius: var(--border-radius);
  border: 1px solid #eee;
}

.search-box input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  width: 250px;
  transition: border-color 0.2s;
  margin-bottom: 0;
}

.search-box input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.filter-options {
  display: flex;
  align-items: center;
}

.filter-options select {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  margin-left: 10px;
}

/* Button styling */
/*.button {
  padding: 8px 12px;
  border: none;
  border-radius: var(--border-radius);
  background-color: #f2f2f2;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.button:hover {
  background-color: #e0e0e0;
}*/

.success.button {
  background-color: var(--primary-color);
  color: white;
}

.button.btn-red {
  background-color: var(--danger-color);
  color: white;
}

.success.button:hover {
  background-color: var(--primary-dark);
}

.small.button {
  padding: 6px 8px;
  font-size: 12px;
  margin-bottom: 4px;
}

/* Status badge styling */
.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.status-new {
  background-color: #e3f2fd;
  color: #1565c0;
}

.status-processing {
  background-color: #fff8e1;
  color: #ff8f00;
}

.status-scheduled {
  background-color: #e8f5e9;
  color: var(--success-color);
}

.status-completed {
  background-color: #e8f5e9;
  color: var(--success-color);
}
.status-cancelled {
  background-color: var(--red-light);
  color: var(--danger-color);
}

.payment-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.payment-paid {
  background-color: #e8f5e9;
  color: var(--success-color);
}

.payment-pending {
  background-color: #fff8e1;
  color: #ff8f00;
}

.payment-overdue {
  background-color: #ffebee;
  color: var(--danger-color);
}

/* Progress bar styling */
.order-progress-bar {
  height: 12px;
  background-color: #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.order-progress {
  height: 100%;
  transition: width 0.3s ease;
  background: linear-gradient(to right, #66bb6a, #43a047);
  border-radius: 6px;
  font-size: 9px;
  line-height: 12px;
  text-align: center;
  color: white;
}

/* Modal styling */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fff;
  margin: 3% auto;
  padding: 25px;
  border-radius: 8px;
  width: 80%;
  max-width: 800px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
  margin-top: 0;
  color: var(--primary-dark);
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.close {
  color: #aaa;
  float: right;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close:hover {
  color: #333;
}

/* Form styling */
.form-row {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.form-row.totals {
  margin-top: 20px;
}

.form-group {
  flex: 1;
  min-width: 200px;
  margin-right: 15px;
}

.form-group:last-child {
  margin-right: 0;
}

.form-group.full-width {
  flex: 0 0 100%;
}

.form-group.actions {
  flex: 0 0 auto;
  min-width: auto;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  transition: border-color 0.2s;
}

.form-group select {
    padding: 3px 8px;
    padding-right: 23px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.1);
}

.form-actions {
  text-align: right;
  margin-top: 20px;
}

/* Analytics styling */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.analytics-card {
  background-color: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.analytics-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.analytics-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 14px;
  color: #777;
}

.analytics-chart {
  background-color: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  grid-column: span 2;
}

.analytics-chart h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 16px;
  color: #555;
}

#sales-trend-chart,
#product-sales-chart,
#customer-analysis-chart,
#delivery-heatmap-chart {
    height: 220px;
    position: relative;
}

.no-data {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #777;
    font-style: italic;
    background-color: #f9f9f9;
    border-radius: 4px;
}

/* Heatmap Styling */
.heatmap-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.heatmap-header {
    display: flex;
    margin-bottom: 10px;
}

.heatmap-day {
    flex: 1;
    text-align: center;
    font-weight: bold;
    font-size: 13px;
}

.heatmap-body {
    display: flex;
    flex: 1;
}

.heatmap-cell {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    margin: 0 2px;
}

.heatmap-value {
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.card-value {
  font-size: 26px;
  font-weight: bold;
  margin: 10px 0;
  color: #333;
}

.card-trend {
  font-size: 13px;
}

.card-trend.up {
  color: var(--success-color);
}

.card-trend.down {
  color: var(--danger-color);
}

.card-info {
  font-size: 13px;
  color: #777;
}

/* Delivery date styling */
.delivery-date-header {
  background-color: var(--gray-semi) !important;
}

.delivery-date-summary {
  padding: 12px 15px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.delivery-date-summary strong {
  color: var(--primary-dark);
  margin-right: 10px;
}

.today-label, .tomorrow-label {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: bold;
}

.today-label {
  background-color: var(--success-color);
  color: white;
}

.tomorrow-label {
  background-color: var(--accent-color);
  color: white;
}



/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .analytics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .analytics-chart {
    grid-column: span 2;
  }
  
  .form-group {
    min-width: 100%;
    margin-right: 0;
    margin-bottom: 15px;
  }

  .modal-content {
      width: 95%;
      padding: 18px;
  }

  .form-actions {
    margin-bottom: 20px;
  }
}

@media screen and (max-width: 480px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  
  .analytics-chart {
    grid-column: span 1;
  }
  
  .tabs {
    flex-wrap: wrap;
  }
  
  .tab-link {
    flex: 1 0 auto;
    text-align: center;
  }
}

/* Add smooth transitions for tab switching */
.tab-pane {
  transition: opacity 0.2s ease-in-out;
}

.auto-allocate-container {
    margin: 15px 0;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}
#auto-allocate-btn {
    background-color: #2271b1;
    color: white;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    margin-right: 10px;
}
#auto-allocate-btn:hover {
    background-color: #135e96;
}
.success-message {
    color: #2e7d32;
    font-weight: bold;
}
.warning-message {
    color: #ef6c00;
    font-weight: bold;
}

.note-warning {
    font-size: 14px;
    color: #434242;
    padding: 4px 12px;
    background: #ffe5d9;
}







/* General Form Styles */
#order-form {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

#products-container .form-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 15px;
    align-items: center;
}

#products-container .form-group {
    margin-right: 15px;
    margin-bottom: 10px;
    flex: 1;
    min-width: 200px;
}

#products-container .form-group.full-width {
    width: 100%;
    flex-basis: 100%;
}

#products-container .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

#products-container .form-group input[type="text"],
#products-container .form-group input[type="number"],
#products-container .form-group select,
#products-container .form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#products-container .form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}


/* Products Grid Styles */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Product Card Styles */
.product-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.product-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.product-header {
    padding: 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.product-image {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    flex-shrink: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.product-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Variations Table Styles */
.variations-container {
    padding: 15px;
}

.variations-table {
    width: 100%;
    border-collapse: collapse;
}

.variations-table th {
    text-align: left;
    padding: 8px 5px;
    font-weight: 500;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid #eee;
}

.variations-table td {
    padding: 10px 5px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
    vertical-align: middle;
}

.variations-table tr:last-child td {
    border-bottom: none;
}

.variation-weight {
    font-weight: 500;
}

.variation-price {
    color: #4CAF50;
    font-weight: 500;
}

/* Quantity Control Styles */
.quantity-control {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
    padding: 0;
}

.quantity-btn:hover {
    background: #ebebeb;
}

.minus-btn {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.plus-btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.quantity-input {
    width: 40px;
    height: 28px;
    padding: 0 5px;
    text-align: center;
    border: 1px solid #ddd;
    border-left: none;
    border-right: none;
    border-radius: 0;
    font-size: 14px;
    margin-bottom: 0;
}

.quantity-input::-webkit-inner-spin-button, 
.quantity-input::-webkit-outer-spin-button { 
    -webkit-appearance: none;
    margin: 0;
}

/* Order Totals */
.totals {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-weight: 500;
}

.totals .form-group {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.totals label {
    margin-right: 10px;
    margin-bottom: 0;
}

#total-weight, #total-price {
    font-size: 18px;
    color: #4CAF50;
}

/* Loading indicator */
.loading-indicator {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Error messages */
.error-message {
    color: #d32f2f;
    padding: 15px;
    background-color: #fdecea;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-group {
        width: 100%;
        margin-right: 0;
    }
    
    /*.product-header {
        flex-direction: column;
        text-align: center;
    }
*/    
    /*.product-image {
        margin-right: 0;
        margin-bottom: 10px;
    }*/
    
    .totals .form-group {
        justify-content: space-between;
    }
    
    .variations-table {
        font-size: 13px;
    }
    
    .variations-table th,
    .variations-table td {
        padding: 8px 4px;
    }
    
    .quantity-control {
        justify-content: center;
    }
}

/* For very small screens */
@media screen and (max-width: 375px) {
    .variations-table th {
        font-size: 12px;
    }
    
    .variations-table td {
        font-size: 12px;
    }
    
    .quantity-input {
        width: 30px;
    }
    
    /*.quantity-btn {
        width: 24px;
        height: 24px;
    }*/
}


/* Admin-specific Modal Styles */
/*.modal.admin-form {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal.admin-form .modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal.admin-form .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.modal.admin-form .close:hover,
.modal.admin-form .close:focus {
    color: black;
    text-decoration: none;
}*/

/* Admin price input styles */
.admin-price-input {
    width: 70px;
    padding: 4px 6px;
    text-align: right;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    margin-bottom: 0;
}

.admin-price-input:focus {
    border-color: #4CAF50;
    outline: none;
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.admin-price-input:hover {
    background-color: #f0f0f0;
}

/* Admin specific buttons */
.btn-red {
    background-color: #f44336;
    color: white;
    border-color: #f44336;
}

.btn-red:hover {
    background-color: #d32f2f;
    border-color: #d32f2f;
}

/* Tooltip for admin price double-click */
.admin-form .variation-price {
    position: relative;
}

.admin-form .variation-price::after {
    content: "Double-click to reset";
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}

.admin-form .variation-price:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Admin product grid tweaks */
.admin-form .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.admin-form .product-card {
    margin-bottom: 15px;
}

.admin-form .product-title {
    font-size: 15px;
}

/* Admin form layout adjustments */
.admin-form .form-row {
    align-items: flex-start;
}

/* Customer vs product selection */
#order-customer {
    min-width: 200px;
}

/* Order Form Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.new-order-btn, 
.edit-order-btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.new-order-btn {
    background-color: #4CAF50;
    color: white;
    border: 1px solid #4CAF50;
}

.new-order-btn:hover {
    background-color: #3d8b40;
    border-color: #3d8b40;
}

.edit-order-btn {
    background-color: #2196F3;
    color: white;
    border: 1px solid #2196F3;
}

.edit-order-btn:hover {
    background-color: #0b7dda;
    border-color: #0b7dda;
}

/* Admin orders table improvements */
.admin-orders-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.admin-orders-table th,
.admin-orders-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

.admin-orders-table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.admin-orders-table tr:hover {
    background-color: #f9f9f9;
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-new {
    background-color: #bbdefb;
    color: #0d47a1;
}

.status-processing {
    background-color: #fff9c4;
    color: #f57f17;
}

.status-completed {
    background-color: #c8e6c9;
    color: #1b5e20;
}

.status-cancelled {
    background-color: #ffcdd2;
    color: #b71c1c;
}







/* Improved Mobile View CSS */

/* Main container */
.orders-list-container {
  width: 100%;
  border: 1px solid var(--gray-medium);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  background-color: white;
  margin-top: 18px;
  margin-bottom: 18px;
}

/* Headers Row - Desktop only */
.orders-header-row {
  display: flex;
  background-color: var(--gray-light);
  font-weight: bold;
  border-bottom: 1px solid var(--gray-medium);
}

.order-header-cell {
  padding: 12px 10px;
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 14px;
  text-align: left;
}

/* Order Row Group - Contains main row and expandable products */
.order-row-group {
  border-bottom: 1px solid var(--gray-medium);
}

.order-row-group:last-child {
  border-bottom: none;
}

.order-row-group:nth-child(even) .order-row {
  background-color: #f9f9f9;
}

.order-row-group:hover .order-row {
  background-color: rgba(165, 214, 167, 0.1);
}

/* Main Order Row */
.order-row {
  display: flex;
  width: 100%;
}

/* Cells container - allows for row display on desktop */
.order-cells-container {
  display: flex;
  width: 100%;
  align-items: center;
}

/* Individual cells - Fixed flex settings for proper alignment */
.order-cell {
  padding: 12px 10px;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Fixed column widths for consistent alignment */
.order-cell[data-label="Nr."],
.order-header-cell:nth-child(1) {
  flex: 0.6;
  min-width: 70px;
}

.order-cell[data-label="Data"],
.order-header-cell:nth-child(2) {
  flex: 1;
  min-width: 90px;
}

.order-cell[data-label="Viso suma"],
.order-header-cell:nth-child(3) {
  flex: 0.8;
  min-width: 100px;
}

.order-cell[data-label="Reikalingas pristatymas"],
.order-header-cell:nth-child(4) {
  flex: 1;
  min-width: 120px;
}

.order-cell[data-label="Statusas"],
.order-header-cell:nth-child(5) {
  flex: 1.3;
  min-width: 120px;
}

.order-cell[data-label="Apmokėjimas"],
.order-header-cell:nth-child(6) {
  flex: 1;
  min-width: 100px;
}

.order-cell[data-label="Veiksmai"],
.order-header-cell:nth-child(7) {
  flex: 1.3;
  min-width: 140px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Expand button cell */
.expand-cell,
.order-header-cell:nth-child(8) {
  flex: 0.8;
  min-width: 110px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Improved expand button styling */
.expand-products-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--primary-color);
  padding: 6px 10px;
  border-radius: 4px;
  transition: all 0.2s;
  font-size: 13px;
  white-space: nowrap;
}

.expand-products-btn:hover {
  background-color: rgba(165, 214, 167, 0.2);
}

.products-count {
  background-color: var(--primary-light);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: bold;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  margin-left: 2px;
  text-align: center;
  display: inline-block;
}

/* Products row - hidden by default */
.products-row {
  display: none;
  background-color: white;
  border-top: 1px solid #eaeaea;
}

.order-row-group.expanded .products-row {
  display: block;
}

.products-container {
  padding: 8px;
}

/* Products table styling */
.products-table {
  width: 100%;
  background-color: white;
  overflow: hidden;
}

.products-table-header {
  display: flex;
  background-color: white;
  border-bottom: 1px solid #eaeaea;
  font-weight: 600;
  font-size: 13px;
  color: var(--gray-dark);
}

.products-table-body {
  max-height: 300px;
  overflow-y: auto;
}

.product-row {
  display: flex;
  border-bottom: 1px solid #f0f0f0;
}

.product-row:last-child {
  border-bottom: none;
}

.product-cell {
  padding: 12px 15px;
  font-size: 13px;
  display: flex;
  align-items: center;
  position: relative;
}

/* Vertical separators for cells */
.product-cell:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background-color: #f0f0f0;
}

.product-name-cell {
  flex: 3;
}

.product-quantity-cell,
.product-weight-cell,
.product-price-cell,
.product-total-cell {
  flex: 1;
  justify-content: flex-end;
  text-align: right;
}

/* Product totals */
.products-table-footer {
  border-top: 1px solid #eaeaea;
  padding: 12px 15px;
  font-size: 13px;
}

.product-totals {
  margin-left: auto;
  width: 250px;
}

.product-total-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
}

.product-total-label {
  font-weight: 600;
  color: var(--gray-dark);
}

.product-total-value {
  font-weight: 600;
  color: var(--primary-dark);
}

.no-products {
  padding: 15px;
  color: var(--gray-dark);
  font-style: italic;
  text-align: center;
}

/* No orders message */
.no-orders-row {
  padding: 20px;
  text-align: center;
  color: var(--gray-dark);
}

/* Mobile header - only for very small screens */
.order-mobile-header {
  display: none;
  padding: 12px 15px;
  font-weight: 600;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
}

.order-expand-btn {
  transition: transform 0.2s ease;
}

.order-row-group.mobile-expanded .order-expand-btn,
.order-row-group.expanded .expand-products-btn svg {
  transform: rotate(180deg);
}

.product-detail-label {
  display: none;
}

/* Responsive adjustments */
@media screen and (max-width: 991px) {
  .product-detail-label {
    display: block;
    color: #777;
    font-size: 12px;
    margin-bottom: 2px;
    font-weight: normal;
  }

  /* Mobile view styling - card-based layout */
  .orders-list-container {
    background-color: none;
    border: none;
    padding: 0px;
    box-shadow: none;
  }
  
  .order-row-group {
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  
  /* Hide desktop elements */
  .orders-header-row {
    display: none;
  }
  
  .order-row {
    display: block;
  }
  
  /* Order header section */
  .order-cells-container {
    display: block;
    padding: 0;
  }
  
  /* Order number and date section */
  .order-cell[data-label="Nr."] {
    display: block;
    padding: 5px 15px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid #eaeaea;
    background-color: #fafafa;
  }
  
  .order-cell[data-label="Data"] {
    display: inline-block;
    padding: 15px 15px 0;
    border: none;
    font-size: 14px;
    color: #666;
  }
  
  .order-cell[data-label="Viso suma"] {
    display: inline-block;
    float: right;
    padding: 15px 15px 0;
    font-weight: 600;
    border: none;
    color: var(--primary-dark);
  }
  
  /* Delivery date */
  .order-cell[data-label="Reikalingas pristatymas"] {
    display: block;
    padding: 0 15px 15px;
    border-bottom: 1px solid #eaeaea;
    color: #666;
  }
  
  /* Status badges row */
  .order-cell[data-label="Statusas"],
  .order-cell[data-label="Apmokėjimas"] {
    display: inline-block;
    padding: 15px 5px 15px 15px;
    border: none;
  }
  
  /* Actions row */
  .order-cell[data-label="Veiksmai"] {
    display: flex;
    padding: 10px;
    border-top: 1px solid #eaeaea;
    justify-content: center;
    gap: 10px;
  }
  
  /* Fix action button visibility */
  /*.order-cell.order-actions .button.hide {
    display: inline-block !important;
  }*/
  
  /* Products expand button */
  .expand-cell {
    display: block;
    padding: 0;
    border-top: 1px solid #eaeaea;
  }
  
  .expand-products-btn {
    width: 100%;
    padding: 12px;
    justify-content: center;
    border-radius: 0;
    background-color: #e8f5e9;
    color: var(--primary-dark);
    font-weight: 500;
  }
  
  .expand-products-btn:hover {
    background-color: #d5ecd8;
  }
  
  /* Product section styling */
  .products-row {
    border-top: 1px solid #eaeaea;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    overflow: hidden;
  }
  
  /* Product table */
  .products-table {
    margin: 0;
    border: none;
  }
  
  .products-table-header {
    display: none;
  }
  
  .product-row {
    border-bottom: 1px solid #eaeaea;
    padding: 6px 10px;
  }
  
  .product-row:last-child {
    border-bottom: none;
  }
  
  .product-cell {
    padding: 5px 0;
    /*border-bottom: 1px solid #f0f0f0;*/
    flex-wrap: wrap;
  }
  
/*  .product-cell:last-child {
    border-bottom: none;
  }*/
  
  /* Remove vertical separators */
  .product-cell::after {
    display: none;
  }
  
  /* Product cell grid layout */
  .product-cell.product-name-cell {
    /*flex: 0 0 100%;*/
    font-weight: 600;
   /* padding-bottom: 10px;*/
    display: inline-block;
    width: 20%;

  }
  
  .product-cell.product-weight-cell,
  .product-cell.product-price-cell,
  .product-cell.product-quantity-cell,
  .product-cell.product-total-cell {
    /*flex: 0 0 50%;*/
    justify-content: flex-start;
    padding: 5px 0;
    display: inline-block;
    width: 20%;
    flex: none;
  }
  
  /* Add labels before content */
  .product-cell::before {
    content: attr(data-label);
    font-weight: 500;
    color: #666;
    display: inline-block;
    width: 60px;
    margin-right: 10px;
  }
  
  .product-name-cell::before { display: none; }
  
  /* Product totals */
  .products-table-footer {
    padding: 10px;
    background-color: #fafafa;
  }
  
  .product-totals {
    width: 100%;
    max-width: 100%;
  }
  
  .product-total-row {
    display: flex;
    justify-content: space-between;
    /*font-size: 15px;*/
  }
  
  .product-total-label {
    font-weight: 600;
  }
  
  .product-total-value {
    font-weight: 600;
    color: var(--primary-dark);
  }

  .product-header .product-image {
    display: none;
  }
}

/* Very small screens */
@media screen and (max-width: 480px) {
  .order-cell[data-label="Statusas"],
  .order-cell[data-label="Apmokėjimas"] {
    padding: 10px 5px 10px 15px;
  }
  
  .order-cell[data-label="Veiksmai"] {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .order-cell.order-actions .button {
    width: 100%;
    text-align: center;
  }
  
  /*.product-cell.product-weight-cell,
  .product-cell.product-price-cell,
  .product-cell.product-quantity-cell,
  .product-cell.product-total-cell {
    flex: 0 0 100%;
  }*/

 

}







/* STOCK TAB */

.upcoming-harvests {
  margin-bottom: 100px;
}

/* Stock Management Styles */
.stock-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}

.stock-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 15px;
    /*max-height: 600px;
    overflow-y: auto;*/
    padding-right: 5px;
}

.stock-card {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.stock-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    /*transform: translateY(-2px);*/
}

.stock-card-header {
    padding: 12px 15px;
    background-color: #f5f7f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stock-card-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.stock-status {
    font-size: 12px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 12px;
    background-color: #eee;
}

.stock-card-body {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.stock-value {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stock-number {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.stock-label {
    font-size: 12px;
    color: #777;
}

.stock-projections {
    display: flex;
    gap: 15px;
}

.stock-projection {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.projection-number {
    font-size: 16px;
    font-weight: bold;
    color: #4caf50;
}

.projection-label {
    font-size: 11px;
    color: #777;
}

.stock-card-footer {
    padding: 12px 15px;
    background-color: #fafafa;
}

.stock-metrics {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.metric {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 11px;
    color: #777;
}

.metric-value {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

/* CSS for the added stock order info section */
/* Stock Orders Info Section */
.stock-orders-info {
    padding: 10px 15px;
    background-color: #f5f9ff;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.pending-orders, .buffer-required, .growing-amount, .min-stock-level {
    flex: 1;
    min-width: 30%;
    display: flex;
    flex-direction: column;
}

.pending-orders .info-value {
    color: #e65100;
    font-weight: bold;
}

.buffer-required .info-value {
    color: #1976d2;
    font-weight: bold;
}

.growing-amount .info-value {
    color: #2e7d32;
    font-weight: bold;
}

.min-stock-level .info-value {
    color: #9c27b0;
    font-weight: bold;
}

.info-label {
    color: #757575;
    font-size: 11px;
    margin-bottom: 3px;
}

/* Batch Freshness */
.batch-freshness {
    padding: 8px 15px;
    background-color: #f9f9f9;
    font-size: 11px;
    border-bottom: 1px solid #eee;
}

.batch-age {
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 4px;
    padding: 2px 4px;
    border-radius: 3px;
}

.batch-age.fresh {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.batch-age.aging {
    background-color: #fff8e1;
    color: #ff8f00;
}

/* Stock Recommendation Styles */
.stock-recommendation {
    font-size: 13px;
    padding: 8px;
    background-color: #f0f4f8;
    border-radius: 4px;
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.stock-recommendation .urgent {
    color: #d32f2f;
    background-color: #ffebee;
    padding: 2px 5px;
    border-radius: 3px;
    display: inline-block;
}

.stock-recommendation .warning {
    color: #ff8f00;
    background-color: #fff8e1;
    padding: 2px 5px;
    border-radius: 3px;
    display: inline-block;
}

.stock-recommendation small {
    display: block;
    margin-top: 3px;
    color: #666;
    width: 100%;
}

/* Planning Table Improvements */
.planning-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 5px;
    overflow: hidden;
}

.planning-table th,
.planning-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.planning-table th {
    background-color: #f5f7f9;
    font-weight: bold;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 1;
}

.planning-status-critical {
    background-color: #fff5f5;
}

.planning-status-low {
    background-color: #fffbf0;
}

.planning-table small {
    color: #666;
    display: block;
    margin-top: 3px;
}
/* Expiring Stock Styling */
.expiring-note {
    display: block;
    font-size: 11px;
    color: #ff8f00;
    margin-top: 3px;
}

.expiring-text {
    display: block;
    color: #ff8f00;
    font-style: italic;
}

/* Enhanced Stock Status Display */
.stock-status {
    font-size: 12px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 12px;
}

.stock-status-critical .stock-status {
    background-color: #ffebee;
    color: #d32f2f;
}

.stock-status-low .stock-status {
    background-color: #fff8e1;
    color: #ff8f00;
}

.stock-status-medium .stock-status {
    background-color: #e3f2fd;
    color: #1976d2;
}

.stock-status-good .stock-status {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.stock-status-unknown .stock-status {
    background-color: #f5f5f5;
    color: #757575;
}

/* Improved Planning Table Row Styling */
.planning-table tr.planning-status-critical {
    background-color: rgba(255, 235, 238, 0.7);
}

.planning-table tr.planning-status-low {
    background-color: rgba(255, 248, 225, 0.7);
}

.planning-table tr.planning-status-medium {
    background-color: rgba(227, 242, 253, 0.3);
}

.planning-table tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Enhanced Batch Freshness Display */
.batch-age.aging {
    background-color: #fff8e1;
    color: #ff8f00;
    border-left: 2px solid #ff8f00;
    padding-left: 4px;
}

.batch-age.fresh {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-left: 2px solid #2e7d32;
    padding-left: 4px;
}



.start-batch-btn {
    white-space: nowrap;
    margin-left: 10px !important;
}

/* Stock status colors */
.stock-status-critical .stock-status {
    background-color: #ffebee;
    color: #d32f2f;
}

.stock-status-low .stock-status {
    background-color: #fff8e1;
    color: #ff8f00;
}

.stock-status-medium .stock-status {
    background-color: #e3f2fd;
    color: #1976d2;
}

.stock-status-good .stock-status {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.stock-status-unknown .stock-status {
    background-color: #f5f5f5;
    color: #757575;
}

/* Stock Forecast Chart */
.forecast-chart-container {
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 15px;
    height: 300px;
}

/* Planning Table Styles */
.planning-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 5px;
    overflow: hidden;
}

.planning-table th,
.planning-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.planning-table th {
    background-color: #f5f7f9;
    font-weight: bold;
    color: #333;
}

.planning-status-critical {
    background-color: #fff5f5;
}

.planning-status-low {
    background-color: #fffbf0;
}

/*.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}*/

.status-critical {
    background-color: #ffebee;
    color: #d32f2f;
}

.status-low {
    background-color: #fff8e1;
    color: #ff8f00;
}

.status-medium {
    background-color: #e3f2fd;
    color: #1976d2;
}

.status-good {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-unknown {
    background-color: #f5f5f5;
    color: #757575;
}

.stock-recommendation .urgent {
    color: #d32f2f;
    background-color: #ffebee;
    padding: 2px 5px;
    border-radius: 3px;
    display: inline-block;
    margin: 3px 0px;
}

.stock-recommendation .warning {
    color: #ff8f00;
    background-color: #fff8e1;
    padding: 2px 5px;
    border-radius: 3px;
    display: inline-block;
    margin: 3px 0px;
}

.debug-info {
    border-left: 3px solid #ccc;
    padding-left: 5px;
    margin-top: 5px;
    font-family: monospace;
}

/* Harvests Calendar */
#harvests-calendar {
    margin-top: 15px;
    height: 400px;
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Responsive layout for larger screens */
@media (min-width: 1200px) {
    .stock-dashboard {
        grid-template-columns: 2fr 1fr;
        grid-template-areas: 
            "summary forecast"
            "planning planning"
            "harvests harvests";
    }
    
    .stock-summary {
        grid-area: summary;
    }
    
    .stock-forecast {
        grid-area: forecast;
    }
    
    .stock-planning {
        grid-area: planning;
    }
    
    .upcoming-harvests {
        grid-area: harvests;
    }
}





/* Improved Batch Allocation Styling */

/* Freshness indicator colors */
.freshness-indicator {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}

.freshness-indicator.fresh {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.freshness-indicator.aging {
    background-color: #fff8e1;
    color: #ff8f00;
}

.freshness-indicator.critical {
    background-color: #ffebee;
    color: #d32f2f;
}

.freshness-indicator.expired {
    background-color: #efebe9;
    color: #6d4c41;
    text-decoration: line-through;
}

/* Row highlighting based on freshness */
.batch-table tr.freshness-fresh {
    background-color: rgba(232, 245, 233, 0.2);
}

.batch-table tr.freshness-aging {
    background-color: rgba(255, 248, 225, 0.2);
}

.batch-table tr.freshness-critical {
    background-color: rgba(255, 235, 238, 0.2);
}

.batch-table tr.freshness-expired {
    background-color: rgba(239, 235, 233, 0.2);
    color: #9e9e9e;
}

/* Hover effect */
.batch-table tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Improved batch table */
.batch-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.batch-table th {
    background-color: #f5f7f9;
    font-weight: bold;
    padding: 10px;
    text-align: left;
    border-bottom: 2px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1;
}

.batch-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

/* Auto-allocate button with freshness emphasis */
#auto-allocate-btn {
    background-color: #2e7d32;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    margin-top: 15px;
    cursor: pointer;
}

#auto-allocate-btn:hover {
    background-color: #1b5e20;
}

#auto-allocate-message {
    margin-left: 15px;
    line-height: 1.5;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-top: 10px;
}

#auto-allocate-message > span {
  display: block;
}

.success-message {
    color: #2e7d32;
    font-weight: bold;
}

.warning-message {
    color: #ff8f00;
    font-weight: bold;
}

.fresh-allocation {
    color: #2e7d32;
    font-weight: bold;
}

.aging-allocation {
    color: #ff8f00;
    font-weight: bold;
}

.critical-allocation {
    color: #d32f2f;
    font-weight: bold;
}

/* Checkbox styling */
.batch-checkbox {
    transform: scale(1.3);
    cursor: pointer;
}

/* Message styling */
.ready-to-schedule {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 10px;
    border-radius: 4px;
    margin-top: 15px;
    font-weight: bold;
    text-align: center;
}

/* Progress bar */
.order-progress-bar {
    height: 15px;
    background-color: #f5f5f5;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.order-progress {
    height: 100%;
    background-color: #8bc34a;
    border-radius: 10px;
    text-align: right;
    line-height: 15px;
    transition: width 0.5s ease-in-out;
}

.order-progress span {
    margin-right: 5px;
    color: white;
    font-size: 11px;
    font-weight: bold;
}




/* USER - ORDERS  UI */
/* CSS for enhanced product availability UI */

/* Product availability indicators */
.availability-indicator {
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.availability-indicator.in-stock {
    background-color: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
    border-left: 3px solid #2e7d32;
}

.availability-indicator.out-of-stock {
    background-color: rgba(255, 152, 0, 0.1);
    color: #ef6c00;
    border-left: 3px solid #ef6c00;
}

.stock-status {
    display: inline-block;
}

.stock-amount, .next-harvest {
    font-weight: 400;
    margin-left: 5px;
}

/* Out of stock variations */
.variation-row.out-of-stock {
    background-color: rgba(250, 250, 250, 0.5);
    color: #999;
}

.variation-row.out-of-stock .quantity-control {
    opacity: 0.6;
}

/* Available quantity badge */
.available-quantity {
    display: inline-block;
    margin-left: 5px;
    font-size: 0.8em;
    color: #2e7d32;
    font-weight: normal;
}

.available-quantity.limited {
    color: #ef6c00;
}

/* Approval notification banner */
.approval-notification {
    background-color: #fff3e0;
    border: 1px solid #ffe0b2;
    border-left: 4px solid #ff9800;
    padding: 10px 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-size: 0.9em;
    color: #e65100;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    border-top: 4px solid #3498db;
    animation: spin 1s linear infinite;
}

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

/* Tooltip for availability feedback */
.availability-tooltip {
    position: absolute;
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    z-index: 100;
    pointer-events: none;
}

.availability-tooltip::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 10px;
    border-width: 0 5px 5px;
    border-style: solid;
    border-color: transparent transparent #333;
}

/* Product search */
.product-search-container {
    margin: 15px 0;
    position: relative;
}

.product-search {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
}

.product-search:focus {
    border-color: #4CAF50;
    outline: none;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* Product card enhancements */
.product-card {
    transition: all 0.2s ease;
}

.product-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-search-container {
        margin: 10px 0;
    }
    
    .availability-indicator {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stock-amount, .next-harvest {
        margin-left: 0;
        margin-top: 2px;
    }
}