/* 雅百颜管理后台 - 样式 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  font-size: 14px;
}

/* 登录页 */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #d44a44, #ff6b6b);
}

.login-box {
  background: #fff;
  padding: 60px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: 400px;
}

.login-title {
  font-size: 32px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 40px;
  color: #d44a44;
}

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

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

.form-group input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: #d44a44;
}

.login-btn {
  width: 100%;
  padding: 16px;
  background: #d44a44;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

.login-btn:hover {
  background: #c43c3c;
}

/* 后台布局 */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: 240px;
  background: #1a1a2e;
  color: #fff;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px;
  font-size: 22px;
  font-weight: bold;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: #d44a44;
}

.sidebar-nav {
  padding: 20px 0;
}

.nav-item {
  padding: 16px 24px;
  cursor: pointer;
  transition: background 0.3s;
  display: flex;
  align-items: center;
}

.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,0.1);
}

.nav-item.active {
  background: rgba(212, 74, 74, 0.3);
  border-left: 4px solid #d44a44;
}

.nav-icon {
  width: 24px;
  height: 24px;
  margin-right: 12px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
}

.nav-item span {
  font-size: 15px;
}

/* 主内容区 */
.main-content {
  flex: 1;
  margin-left: 240px;
}

/* 顶部栏 */
.header {
  background: #fff;
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left h1 {
  font-size: 24px;
  font-weight: bold;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

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

.user-avatar {
  width: 40px;
  height: 40px;
  background: #d44a44;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
}

.logout-btn {
  padding: 8px 20px;
  background: #f5f5f5;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

.logout-btn:hover {
  background: #e5e5e5;
}

/* 内容区域 */
.content {
  padding: 30px;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 30px;
}

.stat-card {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 24px;
}

.stat-card.sales .stat-icon { background: #fff3e0; color: #ff9500; }
.stat-card.orders .stat-icon { background: #e3f2fd; color: #007aff; }
.stat-card.users .stat-icon { background: #e8f5e9; color: #4cd964; }
.stat-card.agents .stat-icon { background: #fce4ec; color: #d44a44; }

.stat-card .stat-value {
  font-size: 32px;
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 14px;
  color: #999;
}

/* 数据表格 */
.data-table {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.table-header h2 {
  font-size: 18px;
  font-weight: bold;
}

.search-box {
  display: flex;
  gap: 10px;
}

.search-box input {
  padding: 10px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  width: 240px;
}

.search-box button, .btn {
  padding: 10px 20px;
  background: #d44a44;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

.search-box button:hover, .btn:hover {
  background: #c43c3c;
}

.btn-secondary {
  background: #f5f5f5;
  color: #333;
}

.btn-secondary:hover {
  background: #e5e5e5;
}

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

thead {
  background: #f9f9f9;
}

th, td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

th {
  font-weight: 600;
  color: #666;
}

tbody tr:hover {
  background: #fafafa;
}

.status {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status.pending { background: #fff3e0; color: #ff9500; }
.status.paid { background: #e3f2fd; color: #007aff; }
.status.shipped { background: #e8f5e9; color: #4cd964; }
.status.completed { background: #f5f5f5; color: #999; }

.action-btn {
  padding: 6px 14px;
  background: #f5f5f5;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  margin-right: 8px;
  transition: background 0.3s;
}

.action-btn:hover {
  background: #e5e5e5;
}

.action-btn.danger {
  background: #ffeaea;
  color: #d44a44;
}

.action-btn.danger:hover {
  background: #ffd5d5;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  gap: 8px;
}

.pagination button {
  padding: 8px 14px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.pagination button.active {
  background: #d44a44;
  color: #fff;
  border-color: #d44a44;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 表单弹窗 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 30px;
  width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: bold;
}

.modal-close {
  width: 32px;
  height: 32px;
  background: #f5f5f5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
}

.modal-close:hover {
  background: #e5e5e5;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-full {
  grid-column: span 2;
}

.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  resize: vertical;
  min-height: 100px;
}

.form-group textarea:focus {
  outline: none;
  border-color: #d44a44;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 0;
  color: #999;
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
}

/* 响应式 */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }
  
  .sidebar-logo span, .nav-item span {
    display: none;
  }
  
  .main-content {
    margin-left: 60px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}