 /**
 * 销售出库明细模块样式
 */

/* 模块容器 */
.sales-outbound-module {
  padding: 12px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* 页面标题 */
.page-header {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e8e8e8;
}

.page-header h2 {
  margin: 0;
  font-size: 18px;
  color: #333;
}

/* 筛选栏 */
.filter-bar {
  background: #fafafa;
  padding: 10px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.filter-row:last-child {
  margin-bottom: 0;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-item label {
  font-size: 13px;
  color: #666;
  white-space: nowrap;
}

.filter-item select,
.filter-item input[type="text"],
.filter-item input[type="date"] {
  padding: 4px 8px;
  border: 1px solid #d9d9d9;
  border-radius: 3px;
  font-size: 13px;
  min-width: 100px;
}

.filter-item input[type="date"] {
  min-width: 110px;
}

.filter-item select:focus,
.filter-item input:focus {
  border-color: #40a9ff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.filter-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* 统计汇总 */
.summary-stats {
  display: flex;
  gap: 20px;
  padding: 8px 12px;
  background: #e6f7ff;
  border-radius: 4px;
  margin-bottom: 12px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-label {
  font-size: 13px;
  color: #666;
}

.stat-value {
  font-size: 14px;
  font-weight: 600;
  color: #1890ff;
}

/* 数据表格容器 */
.data-table-container {
  overflow-x: auto;
  margin-bottom: 12px;
}

/* 数据表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid #e8e8e8;
}

/* 出库日期列宽 */
.data-table th:nth-child(1),
.data-table td:nth-child(1) {
  width: 100px;
  min-width: 80px;
  max-width: 100px;
}


/* 客户列宽 */
.data-table th:nth-child(2),
.data-table td:nth-child(2) {
  width: 150px;
  min-width: 80px;
  max-width: 280px;
}

/* 销售区域列宽 */
.data-table th:nth-child(3),
.data-table td:nth-child(3) {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
}

/* 产品列宽 */
.data-table th:nth-child(4),
.data-table td:nth-child(4) {
  width: 150px;
  min-width: 100px;
  max-width: 150px;
}

/* 批号列宽 */
.data-table th:nth-child(5),
.data-table td:nth-child(5) {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

/* 仓库列宽 */
.data-table th:nth-child(6),
.data-table td:nth-child(6) {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
}

/* 数量列宽 */
.data-table th:nth-child(7),
.data-table td:nth-child(7) {
  width: 50px;
  min-width: 50px;
  max-width: 50px;
  text-align: right;
}

/* 单价列宽 */
.data-table th:nth-child(8),
.data-table td:nth-child(8) {
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  text-align: right;
}

/* 金额列宽 */
.data-table th:nth-child(9),
.data-table td:nth-child(9) {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  text-align: right;
}

/* 核销状态列宽 */
.data-table th:nth-child(10),
.data-table td:nth-child(10) {
  width: 80px;
  min-width: 60px;
  max-width: 80px;
  text-align: center;
}

/* 票据情况列宽 */
.data-table th:nth-child(11),
.data-table td:nth-child(11) {
  width: 100px;
  min-width: 80px;
  max-width: 100px;
  text-align: center;
}

/* 发票情况列宽 */
.data-table th:nth-child(12),
.data-table td:nth-child(12) {
  width: 80px;
  min-width: 60px;
  max-width: 80px;
  text-align: center;
}

/* 授权状态列宽 */
.data-table th:nth-child(13),
.data-table td:nth-child(13) {
  width: 100px;
  min-width: 80px;
  max-width: 100px;
  text-align: center;
}

/* 操作列宽 */
.data-table th:nth-child(14),
.data-table td:nth-child(14) {
  width: 100px;
  min-width: 80px;
  max-width: 100px;
  text-align: center;
}

.data-table th {
  background: #fafafa;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.data-table th.sortable:hover {
  background: #f0f0f0;
}

.data-table th.sort-asc .sort-icon::after {
  content: ' ↑';
}

.data-table th.sort-desc .sort-icon::after {
  content: ' ↓';
}

.data-table tbody tr:hover {
  background: #f5f5f5;
}

.data-table tbody tr.row-highlight {
  background: #fff7e6;
}

.data-table tbody tr.row-highlight:hover {
  background: #ffefd1;
}

/* 加载状态 */
.loading-row {
  text-align: center;
  padding: 30px !important;
  color: #999;
}

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #e8e8e8;
  border-top-color: #1890ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-row {
  text-align: center;
  padding: 30px !important;
  color: #999;
}

/* 状态标签 */
.status-tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
}

.status-gray {
  background: #f5f5f5;
  color: #999;
}

.status-green {
  background: #f6ffed;
  color: #52c41a;
}

.status-red {
  background: #fff2f0;
  color: #ff4d4f;
}

.status-yellow {
  background: #fffbe6;
  color: #faad14;
}

.status-default {
  background: transparent;
  color: #999;
}

/* 票据和发票状态颜色 */
.status-blue {
  background: #e6f7ff;
  color: #1890ff;
}

.status-orange {
  background: #fff7e6;
  color: #fa8c16;
}

/* 操作单元格 */
.action-cell {
  white-space: nowrap;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 4px 12px;
  font-size: 13px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

.btn-primary {
  background: #1890ff;
  color: white;
}

.btn-primary:hover {
  background: #40a9ff;
}

.btn-secondary {
  background: white;
  border: 1px solid #d9d9d9;
  color: #666;
}

.btn-secondary:hover {
  border-color: #1890ff;
  color: #1890ff;
}

.btn-danger {
  background: #ff4d4f;
  color: white;
}

.btn-danger:hover {
  background: #ff7875;
}

.btn-small {
  padding: 2px 6px;
  font-size: 12px;
  margin-right: 4px;
}

.btn-page {
  padding: 3px 8px;
  font-size: 13px;
  background: white;
  border: 1px solid #d9d9d9;
  color: #666;
  min-width: 28px;
}

.btn-page:hover:not(:disabled) {
  border-color: #1890ff;
  color: #1890ff;
}

.btn-page:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-page.active {
  background: #1890ff;
  border-color: #1890ff;
  color: white;
}

.btn-edit {
  background: #1890ff;
  color: white;
}

.btn-edit:hover {
  background: #40a9ff;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.pagination-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #666;
}

.pagination-info select {
  padding: 3px 6px;
  border: 1px solid #d9d9d9;
  border-radius: 3px;
  font-size: 13px;
}

.pagination-buttons {
  display: flex;
  gap: 4px;
}

/* 弹窗 */
/* 销售出库明细弹窗样式 */
#modal-container {
  display: none;
}

#modal-container .modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#modal-container .modal-content {
  background: white;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 450px;
  max-width: 750px;
  max-height: 80vh;
  overflow-y: auto;
}

#modal-container .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e8e8e8;
}

#modal-container .modal-header h3 {
  margin: 0;
  font-size: 15px;
}

#modal-container .modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #999;
  padding: 0;
  line-height: 1;
}

#modal-container .modal-close:hover {
  color: #333;
}

#modal-container .modal-body {
  padding: 16px;
}

/* 核销明细 */
.match-summary {
  margin-bottom: 16px;
  padding: 12px;
  background: #fafafa;
  border-radius: 4px;
}

.match-summary p {
  margin: 4px 0;
  font-size: 13px;
}

.match-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.match-table th,
.match-table td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid #e8e8e8;
}

.match-table th {
  background: #fafafa;
  font-weight: 600;
}

.no-data {
  text-align: center;
  color: #999;
  padding: 16px;
  font-size: 13px;
}

/* 表单 */
.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: #666;
}

.form-group input,
.form-group select {
  width: auto;
  padding: 6px 8px;
  border: 1px solid #d9d9d9;
  border-radius: 3px;
  font-size: 13px;
}

.form-group input:focus,
.form-group select:focus {
  border-color: #40a9ff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* Toast动画 */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* 响应式 */
@media (max-width: 1200px) {
  .filter-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .filter-actions {
    margin-left: 0;
    margin-top: 8px;
  }
  
  .summary-stats {
    flex-wrap: wrap;
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .sales-outbound-module {
    padding: 10px;
  }
  
  .modal-content {
    min-width: auto;
    width: 90%;
    margin: 16px;
  }
  
  .pagination {
    flex-direction: column;
    gap: 8px;
  }
}

/* 票据和发票下拉选择框样式 */
.status-select {
  border: 1px solid var(--border-color, #ddd);
  border-radius: 4px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #333);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
}

.status-select:hover:not(:disabled) {
  border-color: var(--primary-color, #3b82f6);
}

.status-select:focus {
  outline: none;
  border-color: var(--primary-color, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.status-select:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  background: var(--bg-secondary, #f5f5f5);
}
