/* 全局样式 */
:root {
  --primary-color: #2c3e50;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --info-color: #0dcaf0;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #2c3e50;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fa;
  padding-top: 0;
}

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1060;
  padding: 48px 0 0;
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
  background-color: #2c3e50;
}

.sidebar .nav-link {
  color: #bdc3c7;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

.sidebar .nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
  color: #ffffff;
  background-color: #34495e;
  border-left: 3px solid #3498db;
}

.sidebar-sticky {
  position: relative;
  top: 0;
  height: calc(100vh - 48px);
  padding-top: .5rem;
  overflow-x: hidden;
  overflow-y: auto;
}

.logo-container {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.main-content {
  margin-left: 16.666667%;
}

.navbar-brand {
  font-weight: bold;
}

.card {
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  transition: box-shadow 0.15s ease-in-out;
  border: none;
}

.card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.table {
  border-radius: 0.5rem;
  overflow: hidden;
}

.table thead th {
  background-color: #2c3e50 !important;
  color: white !important;
  border: none !important;
  font-weight: 500;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table td {
  vertical-align: middle;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

.table-bordered th,
.table-bordered td {
  border-color: #dee2e6;
}

.table-light {
  background-color: #2c3e50 !important;
  color: white !important;
}

.page-title {
  color: #2c3e50;
  font-weight: 600;
  border-bottom: 3px solid #3498db;
  padding-bottom: 0.5rem;
}

.btn {
  border-radius: 0.375rem;
  font-weight: 500;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.action-buttons .btn {
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

.page-title {
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  color: var(--dark-color);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* 状态标签样式 */
.status-badge {
  padding: 0.25em 0.6em;
  font-size: 0.75em;
  font-weight: 500;
  border-radius: 0.375rem;
  text-transform: uppercase;
}

.status-pending {
  background-color: #ffc107;
  color: #000;
}

.status-processing {
  background-color: #0dcaf0;
  color: #000;
}

.status-completed {
  background-color: #198754;
  color: white;
}

.status-cancelled {
  background-color: #6c757d;
  color: white;
}

.status-shipped {
  background-color: #fd7e14;
  color: white;
}

/* 库存数量样式 */
.qty-available {
  color: var(--success-color);
  font-weight: bold;
}

.qty-reserved {
  color: var(--warning-color);
  font-weight: bold;
}

.qty-damaged {
  color: var(--danger-color);
  font-weight: bold;
}

/* 搜索框样式 */
.search-container {
  background: white;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* 表格操作列固定宽度 */
.table-actions {
  width: 120px;
  text-align: center;
}

/* 表格按钮可点击 */
.table td button,
.table th button {
  position: relative;
  z-index: 1;
  cursor: pointer;
  pointer-events: auto !important;
}

.table td button:hover,
.table th button:hover {
  z-index: 2;
}

/* 分页样式 */
.pagination-wrapper {
  margin-top: 1.5rem;
  text-align: center;
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .table-responsive {
    font-size: 0.875rem;
  }
  
  .action-buttons {
    display: flex;
    flex-wrap: wrap;
  }
  
  .action-buttons .btn {
    flex: 1;
    margin: 0.125rem;
  }
}

/* 数据卡片样式 */
.data-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border: none;
  margin-bottom: 1.5rem;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.data-card .card-body {
  padding: 1.5rem;
}

.data-card .card-title {
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 0.5rem;
}

.data-card .card-text {
  color: var(--secondary-color);
  font-size: 1.25rem;
  font-weight: 700;
}

/* 图表容器 */
.chart-container {
  position: relative;
  height: 300px;
  margin: 2rem 0;
}

/* 面包屑导航 */
.breadcrumb-custom {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* 操作按钮组 */
.operation-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* 统计卡片 */
.stats-card {
  text-align: center;
  padding: 1.5rem;
}

.stats-card .stats-number {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.stats-card .stats-label {
  color: var(--secondary-color);
  font-size: 0.875rem;
}

.stats-card .stats-trend {
  margin-top: 0.5rem;
  font-size: 0.75rem;
}

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

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

/* 居中显示的警告框 */
.alert-center {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  min-width: 300px;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .alert-center {
    min-width: 90%;
    left: 5%;
    transform: translateX(0);
  }
}

/* 波次拣货页面按钮样式 */
#wave-list .table td:last-child {
  white-space: nowrap;
  overflow: visible;
}

#wave-list .btn {
  cursor: pointer;
}

/* 模态框内容过长时滚动，确保底部按钮可见 */
#commonModal .modal-body {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

/* 下拉搜索容器 - 确保不裁剪下拉框 */
.item-sku-search-wrapper,
.item-search-select {
  position: relative;
}

/* 搜索下拉选项 hover 效果 */
.sku-option:hover,
.search-option:hover {
  background: #e8f4fd;
}
