/* Order Groups Management Table Styles */

#order-groups-module .card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

#order-groups-module .card-header {
  border-bottom: 1px solid #e9ecef;
  border-radius: 10px 10px 0 0 !important;
}

#order-groups-module .search-bar .input-group {
  border: 1px solid #e9ecef;
  border-radius: 50px;
  transition: all 0.3s ease;
}

#order-groups-module .search-bar .input-group:focus-within {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#order-groups-module .search-bar .form-control {
  border: none;
  border-radius: 50px 0 0 50px;
  padding-left: 15px;
}

#order-groups-module .search-bar .input-group-text {
  border: none;
  border-radius: 0 50px 50px 0;
  background-color: transparent;
}

#order-groups-module .table {
  margin-bottom: 0;
}

#order-groups-module .table thead th {
  font-weight: 600;
  color: #495057;
  border-top: none;
  border-bottom: 2px solid #dee2e6;
}

#order-groups-module .table tbody td {
  vertical-align: middle;
  border-top: 1px solid #dee2e6;
  padding: 12px 8px;
}

#order-groups-module .table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

#order-groups-module .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.01);
}

#order-groups-module .table-striped tbody tr:nth-of-type(even) {
  background-color: rgba(0, 0, 0, 0.03);
}

#order-groups-module .table-striped tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.05) !important;
}

#order-groups-module .action-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
}

#order-groups-module .action-buttons i {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
}

#order-groups-module .action-buttons i.bi-eye {
  background-color: #6c757d;
  color: white;
}

#order-groups-module .action-buttons i.bi-eye:hover {
  background-color: #5a6268;
  transform: translateY(-2px);
}

#order-groups-module .action-buttons i.bi-pencil {
  background-color: #17a2b8;
  color: white;
}

#order-groups-module .action-buttons i.bi-pencil:hover {
  background-color: #138496;
  transform: translateY(-2px);
}

#order-groups-module .action-buttons i.bi-trash {
  background-color: #dc3545;
  color: white;
}

#order-groups-module .action-buttons i.bi-trash:hover {
  background-color: #c82333;
  transform: translateY(-2px);
}

/* New styles for additional icons */
#order-groups-module .action-buttons i.bi-envelope {
  background-color: #007bff;
  color: white;
}

#order-groups-module .action-buttons i.bi-envelope:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
}
#order-groups-module .action-buttons i.bi-file-text {
  background-color: #17a2b8;
  color: white;
}

#order-groups-module .action-buttons i.bi-file-text:hover {
  background-color: #138496;
  transform: translateY(-2px);
}

#order-groups-module .action-buttons i.bi-x-circle {
  background-color: #ffc107;
  color: #212529;
}

#order-groups-module .action-buttons i.bi-x-circle:hover {
  background-color: #e0a800;
  transform: translateY(-2px);
}

#order-groups-module .action-buttons i.bi-file-earmark-pdf {
  background-color: #dc3545;
  color: white;
}

#order-groups-module .action-buttons i.bi-file-earmark-pdf:hover {
  background-color: #c82333;
  transform: translateY(-2px);
}

#order-groups-module .action-buttons i.bi-list {
  background-color: #28a745;
  color: white;
}

#order-groups-module .action-buttons i.bi-list:hover {
  background-color: #218838;
  transform: translateY(-2px);
}

/* New styles for Excel export icon */
#order-groups-module .action-buttons i.bi-file-earmark-excel {
  background-color: #28a745;
  color: white;
}

#order-groups-module .action-buttons i.bi-file-earmark-excel:hover {
  background-color: #218838;
  transform: translateY(-2px);
}

#order-groups-module .pagination-container {
  display: flex;
  justify-content: flex-end;
}

#order-groups-module .form-select {
  cursor: pointer;
}

#order-groups-module .form-select:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Rows per page and row count */
#order-groups-module .rows-per-page .form-select {
  width: auto;
}

#order-groups-module .rows-per-page {
  display: flex;
  align-items: center;
}

#order-groups-module .rows-per-page .form-label {
  margin-right: 8px;
  margin-bottom: 0;
  font-size: 0.875rem;
}

/* Date filter labels */
#order-groups-module .form-label {
  margin-top: 5px;
  margin-bottom: 0;
}

/* Currency formatting styles */
#order-groups-module .currency-cell {
  font-weight: 600;
  color: #28a745;
  text-align: right;
}

#order-groups-module .order-group-total-amount {
  font-weight: 700;
  font-size: 1.1rem;
  color: #28a745;
  text-align: right;
}

#order-groups-module .order-total-input {
  text-align: right;
  font-weight: 600;
  color: #28a745;
}

/* Filter section improvements */
#order-groups-module .card-body .row.g-3 {
  margin-bottom: 0.5rem;
}

#order-groups-module .form-label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.5rem;
}

/* Date filter adjustments */
#order-groups-module #startDateFilter,
#order-groups-module #endDateFilter {
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#order-groups-module #startDateFilter:focus,
#order-groups-module #endDateFilter:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Date filter labels */
#order-groups-module .form-label.date-label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

/* Date range container styling */
#order-groups-module .date-range-container {
  display: flex;
  gap: 0.5rem;
}

#order-groups-module .date-range-container > div {
  flex: 1;
}

/* Button group adjustments */
#order-groups-module .btn-group-filter {
  display: flex;
  align-items: flex-end;
  height: 100%;
  gap: 0.5rem;
}

/* Order Group Modal Styles */
#orderGroupModal .modal-content {
  border-radius: 10px;
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

#orderGroupModal .modal-header {
  background-color: #007bff;
  border-radius: 10px 10px 0 0 !important;
  padding: 1rem 1.5rem;
}

#orderGroupModal .modal-title {
  font-weight: 600;
  color: white;
  font-size: 1.25rem;
}

#orderGroupModal .btn-close {
  filter: invert(1);
}

#orderGroupModal .card {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

#orderGroupModal .card-header {
  border-bottom: 1px solid #e9ecef;
  border-radius: 8px 8px 0 0 !important;
  padding: 0.75rem 1.25rem;
}

#orderGroupModal .card-header.bg-light {
  background-color: #f8f9fa !important;
}

#orderGroupModal .table th {
  font-weight: 600;
  color: #495057;
  background-color: #f8f9fa;
  border-top: none;
}

#orderGroupModal .table td {
  vertical-align: middle;
  padding: 0.75rem;
}

#orderGroupModal .form-label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.25rem;
}

#orderGroupModal .form-select {
  cursor: pointer;
  border-radius: 0.375rem;
}

#orderGroupModal .form-select:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Modal footer buttons */
#orderGroupModal .modal-footer {
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
  border-radius: 0 0 10px 10px !important;
  padding: 1rem 1.5rem;
}

#orderGroupModal .modal-footer .btn {
  padding: 0.5rem 1.5rem;
  font-weight: 500;
  border-radius: 0.375rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #order-groups-module .table-responsive {
    border: none;
  }
  
  #order-groups-module .table thead th,
  #order-groups-module .table tbody td {
    padding: 8px 4px;
    font-size: 0.875rem;
  }
  
  #order-groups-module .action-buttons i {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  
  #order-groups-module .search-bar .form-control {
    padding-left: 10px;
    font-size: 0.875rem;
  }
  
  #order-groups-module .currency-cell {
    font-size: 0.875rem;
  }
  
  /* Adjust filter layout for mobile */
  #order-groups-module .col-md-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  
  #order-groups-module .col-md-3:nth-child(3) {
    margin-top: 1rem;
  }
  
  #order-groups-module .col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
    margin-top: 1rem;
  }
  
  #order-groups-module .mt-0 {
    margin-top: 1rem !important;
  }
  
  /* Adjust button layout for mobile */
  #order-groups-module .btn-group-filter {
    flex-direction: column;
    align-items: stretch;
  }
  
  #order-groups-module .btn {
    margin-bottom: 0.5rem;
    width: 100%;
  }
  
  #order-groups-module .ms-2 {
    margin-left: 0 !important;
  }
  
  /* Modal responsive adjustments */
  #orderGroupModal .modal-dialog {
    margin: 1rem;
  }
  
  #orderGroupModal .table-responsive {
    border: none;
  }
  
  #orderGroupModal .table thead th,
  #orderGroupModal .table tbody td {
    padding: 0.5rem 0.25rem;
    font-size: 0.875rem;
  }
  
  #orderGroupModal .modal-footer {
    flex-direction: column;
  }
  
  #orderGroupModal .modal-footer .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  #orderGroupModal .modal-footer .btn:last-child {
    margin-bottom: 0;
  }
}

@media (max-width: 576px) {
  #order-groups-module .card-header .row > div {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  #order-groups-module .row-count,
  #order-groups-module .rows-per-page {
    margin-top: 10px;
    justify-content: flex-start !important;
  }
  
  #order-groups-module .action-buttons {
    gap: 4px;
  }
  
  #order-groups-module .action-buttons i {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  
  #order-groups-module .currency-cell {
    font-size: 0.8rem;
  }
  
  /* Adjust filter layout for very small screens */
  #order-groups-module .col-md-3 {
    flex: 0 0 100%;
    max-width: 100%;
    margin-top: 1rem;
  }
  
  #order-groups-module .col-md-3:nth-child(3) {
    margin-top: 1rem;
  }
  
  #order-groups-module .mt-0 {
    margin-top: 1rem !important;
  }
  
  /* Adjust button layout for very small screens */
  #order-groups-module .btn-group-filter {
    flex-direction: column;
    align-items: stretch;
  }
  
  /* Styles for expand/collapse arrow icons in contract table */
  .contract-row td:first-child .arrow-icon {
    margin-right: 5px;
    cursor: pointer;
    color: #007bff;
    transition: transform 0.2s ease;
  }
  
  .contract-row td:first-child .arrow-icon.bi-chevron-down {
    transform: rotate(90deg);
  }
  
  .contract-detail-content {
    transition: all 0.3s ease;
  }
  
  #order-groups-module .btn {
    margin-bottom: 0.5rem;
    width: 100%;
  }
  
  #order-groups-module .ms-2 {
    margin-left: 0 !important;
  }
}
/* Status-specific badge styles */
.badge-status.status-pending {
  background-color: #ffc107; /* Yellow */
  color: #212529;
}

.badge-status.status-sent_to_supplier {
  background-color: #0dcaf0; /* Info Blue */
  color: #fff;
}

.badge-status.status-completed {
  background-color: #198754; /* Green */
  color: #fff;
}

.badge-status.status-cancelled {
  background-color: #dc3545; /* Red */
  color: #fff;
}

.badge-status.status-email_failed {
  background-color: #dc3545; /* Red */
  color: #fff;
}

.badge-status.status-email_partial {
  background-color: #6c757d; /* Gray */
  color: #fff;
}