:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #0dcaf0;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --sidebar-width: 250px;
  --header-height: 56px;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
  overflow-x: hidden;
}

/* 登录页面样式 */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.login-form {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
}

.login-form h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* 应用容器样式 */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  z-index: 100;
  padding-top: 1rem;
  background-color: var(--light-color);
  width: var(--sidebar-width);
  transition: all 0.3s;
}

.sidebar .nav-link {
  color: var(--dark-color);
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
  margin-bottom: 0.25rem;
}

.sidebar .nav-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.sidebar .nav-link.active {
  background-color: var(--primary-color);
  color: white;
}

/* 主内容区域 */
.main-content {
  margin-top: var(--header-height);
  padding-left: var(--sidebar-width);
  transition: all 0.3s;
}

.main-area {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

/* 响应式布局 */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    height: auto;
    top: 0;
  }
  
  .main-content {
    padding-left: 0;
    margin-top: 0;
  }
  
  .login-container {
    align-items: flex-start;
    padding-top: 50px;
    padding-bottom: 50px;
  }
}

/* 通用卡片样式 */
.card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-2px);
}

.card-header {
  background-color: white;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  font-weight: 600;
  padding: 1rem 1.5rem;
}

.card-body {
  padding: 1.5rem;
}

/* 表单样式 */
.form-control {
  border-radius: 8px;
  padding: 0.75rem 1rem;
  border: 1px solid #dee2e6;
}

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

/* 按钮样式 */
.btn {
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-weight: 500;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

/* 表格样式 */
.table {
  margin-bottom: 0;
}

.table th {
  background-color: var(--light-color);
  font-weight: 600;
  border-top: none;
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* 分页样式 */
.pagination {
  margin-top: 1rem;
}

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

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

/* 通知样式 */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}

/* 搜索框样式 */
.search-container {
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
}

/* 统计卡片样式 */
.stats-card {
  text-align: center;
  padding: 1.5rem;
  border-radius: 10px;
  color: white;
  margin-bottom: 1rem;
}

.stats-card-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stats-card-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stats-card-warning {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.stats-card-danger {
  background: linear-gradient(135deg, #fc5c7d 0%, #6a82fb 100%);
}

.stats-card .value {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.stats-card .label {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* 九宫格商品展示样式 */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.product-item {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.product-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.product-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 0.5rem;
}

.product-item .name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.product-item .price {
  color: var(--success-color);
  font-weight: bold;
}

/* 销售清单样式 */
.sale-items-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.sale-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.sale-item:last-child {
  border-bottom: none;
}

.sale-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sale-item-quantity {
  width: 60px;
  text-align: center;
}

/* 支付方式选择 */
.payment-methods {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
}

.payment-method {
  flex: 1;
  padding: 1rem;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.payment-method:hover,
.payment-method.selected {
  border-color: var(--primary-color);
  background-color: rgba(13, 110, 253, 0.05);
}
/* 新的顶部导航栏样式 - 按钮式布局 */
.top-nav {
  width: 100%;
  height: var(--header-height, 60px);
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1000;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
}

.nav-brand-text {
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  text-decoration: none;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  margin: 0 2px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 60px;
  font-size: 0.8rem;
}

.nav-btn i {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-btn-active {
  background-color: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
}

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

.user-dropdown {
  position: relative;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.user-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background-color: white;
  min-width: 180px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
  z-index: 1001;
}

.user-dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  text-decoration: none;
  color: #333;
  transition: background-color 0.3s;
}

.dropdown-content a:hover {
  background-color: #f8f9fa;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .top-nav {
    padding: 0 10px;
  }
  
  .nav-menu {
    gap: 5px;
  }
  
  .nav-btn {
    min-width: 50px;
    font-size: 0.7rem;
    padding: 6px 8px;
  }
  
  .nav-btn i {
    font-size: 1rem;
    margin-bottom: 2px;
  }
  
  .nav-brand-text {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .nav-menu {
    gap: 2px;
  }
  
  .nav-btn {
    min-width: 40px;
    font-size: 0.6rem;
    padding: 4px 6px;
    flex-direction: row;
    gap: 0.25rem;
    justify-content: flex-start;
  }
  
  .nav-btn i {
    margin-bottom: 0;
    margin-right: 0.25rem;
    font-size: 1.1rem;
  }
  
  .nav-btn span {
    font-size: 0.6rem;
    white-space: nowrap;
  }
}
