/* 管理员后台样式 */

/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

/* 登录页面 */
.login-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 30px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #2c3e50;
}

.error-message {
  background-color: #ffebee;
  color: #c62828;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 20px;
  text-align: center;
}

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.login-btn {
  width: 100%;
  padding: 12px;
  background-color: #3498db;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.login-btn:hover {
  background-color: #2980b9;
}

/* 管理员容器 */
.admin-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* 头部 */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  background-color: #2c3e50;
  color: #fff;
  height: 60px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.logo {
  font-size: 20px;
  font-weight: bold;
}

.user-info {
  display: flex;
  align-items: center;
}

.user-info span {
  margin-right: 15px;
}

.user-info a {
  color: #fff;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.user-info a:hover {
  background-color: #34495e;
}

/* 内容区域 */
.admin-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* 侧边栏 */
.admin-sidebar {
  width: 250px;
  background-color: #34495e;
  color: #fff;
  overflow-y: auto;
}

.admin-sidebar nav ul {
  list-style: none;
}

.admin-sidebar nav ul li {
  border-bottom: 1px solid #455a64;
}

.admin-sidebar nav ul li a {
  display: block;
  padding: 15px 20px;
  color: #fff;
  text-decoration: none;
  transition: background-color 0.3s;
}

.admin-sidebar nav ul li a:hover {
  background-color: #455a64;
}

.admin-sidebar nav ul li.nav-group span {
  display: block;
  padding: 15px 20px;
  font-weight: bold;
  cursor: pointer;
}

.admin-sidebar nav ul li.nav-group ul {
  background-color: #2c3e50;
}

.admin-sidebar nav ul li.nav-group ul li a {
  padding-left: 40px;
}

/* 主内容区 */
.admin-main {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background-color: #f5f5f5;
}

/* 仪表盘样式 */
.dashboard {
  max-width: 1200px;
}

.dashboard h2 {
  margin-bottom: 20px;
  color: #2c3e50;
}

/* 统计卡片 */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon.sales {
  background-color: #e3f2fd;
  color: #2196f3;
}

.stat-icon.orders {
  background-color: #e8f5e9;
  color: #4caf50;
}

.stat-icon.visitors {
  background-color: #fff3e0;
  color: #ff9800;
}

.stat-icon.products {
  background-color: #f3e5f5;
  color: #9c27b0;
}

.stat-icon.messages {
  background-color: #ffebee;
  color: #f44336;
}

.stat-title {
  font-size: 14px;
  color: #777;
}

.stat-value {
  font-size: 24px;
  font-weight: bold;
  color: #2c3e50;
}

.stat-change {
  font-size: 12px;
  color: #4caf50;
}

/* 仪表盘内容 */
.dashboard-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.dashboard-section {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.dashboard-section h3 {
  margin-bottom: 15px;
  color: #2c3e50;
}

/* 图表容器 */
.chart-container {
  width: 100%;
  height: 300px;
}

/* 最新商品 */
.latest-products {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.product-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px;
  border-bottom: 1px solid #eee;
}

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

.product-name {
  font-weight: bold;
  margin-bottom: 5px;
}

.product-price {
  color: #e74c3c;
  font-weight: bold;
}

/* 最新订单 */
.latest-orders table {
  width: 100%;
  border-collapse: collapse;
}

.latest-orders th,
.latest-orders td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.latest-orders th {
  background-color: #f5f5f5;
  font-weight: bold;
}

/* 按钮样式 */
.btn {
  padding: 8px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background-color: #3498db;
  color: #fff;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-secondary {
  background-color: #95a5a6;
  color: #fff;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-edit {
  background-color: #3498db;
  color: #fff;
}

.btn-delete {
  background-color: #e74c3c;
  color: #fff;
}

.btn-view {
  background-color: #95a5a6;
  color: #fff;
}

/* 表格样式 */
.table-container {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.products-table,
.categories-table,
.orders-table,
.returns-table {
  width: 100%;
  border-collapse: collapse;
}

.products-table th,
.products-table td,
.categories-table th,
.categories-table td,
.orders-table th,
.orders-table td,
.returns-table th,
.returns-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.products-table th,
.categories-table th,
.orders-table th,
.returns-table th {
  background-color: #f5f5f5;
  font-weight: bold;
}

.product-thumbnail {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}

/* 状态标签 */
.status-pending {
  background-color: #fff3cd;
  color: #856404;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.status-processing {
  background-color: #d1ecf1;
  color: #0c5460;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.status-shipped {
  background-color: #d4edda;
  color: #155724;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.status-delivered {
  background-color: #d4edda;
  color: #155724;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.status-cancelled {
  background-color: #f8d7da;
  color: #721c24;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.status-refunded {
  background-color: #f8d7da;
  color: #721c24;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.status-requested {
  background-color: #fff3cd;
  color: #856404;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.status-approved {
  background-color: #d4edda;
  color: #155724;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.status-rejected {
  background-color: #f8d7da;
  color: #721c24;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.status-processed {
  background-color: #d1ecf1;
  color: #0c5460;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .admin-sidebar {
    width: 100%;
    position: absolute;
    z-index: 100;
    display: none;
  }
  
  .admin-main {
    padding: 10px;
  }
  
  .dashboard-content {
    grid-template-columns: 1fr;
  }
  
  .stats-cards {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  
  .table-container {
    overflow-x: auto;
  }
}
