/* 后台管理系统样式 */

/* 全局样式 */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 侧边栏样式 */
.sidebar {
    height: 100vh;
    background-color: #343a40;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    padding-top: 20px;
    width: 250px;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    margin: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s;
}

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

.sidebar .nav-link i {
    margin-right: 10px;
}

/* 主内容区域 */
.main-content {
    margin-left: 250px;
    padding: 20px;
}

/* 卡片样式 */
.card {
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* 统计卡片样式 */
.stats-card {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transition: transform 0.3s;
    background-color: white;
}

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

.stats-card i {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* 页面标题样式 */
.page-header {
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

/* 表格操作按钮样式 */
.table-actions {
    display: flex;
    gap: 5px;
}

/* 状态标签样式 */
.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

/* 加载动画样式 */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* 错误和成功消息样式 */
.error-message {
    color: #dc3545;
    margin-top: 10px;
    display: none;
}

.success-message {
    color: #198754;
    margin-top: 10px;
    display: none;
}

/* 仪表盘容器样式 */
.dashboard-container {
    width: 100%;
}

.dashboard-container h2 {
    margin-bottom: 20px;
}

/* 统计网格布局 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    transition: transform 0.3s;
}

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

.stat-icon {
    background-color: #f8f9fa;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.stat-icon i {
    font-size: 1.5rem;
    color: #007bff;
}

.stat-info h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-info p {
    margin: 0;
    color: #6c757d;
}

/* 仪表盘表格样式 */
.dashboard-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 992px) {
    .dashboard-tables {
        grid-template-columns: 1fr;
    }
}

.table-container {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.table-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

/* 数据表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

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

/* 产品、订单、支付记录容器样式 */
.products-container,
.orders-container,
.payments-container {
    width: 100%;
}

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

.section-header h2 {
    margin: 0;
}

/* 筛选控件样式 */
.filter-controls {
    display: flex;
    gap: 10px;
}

.filter-controls select,
.filter-controls input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.modal-body {
    padding: 20px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

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

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.form-control-sm {
    padding: 4px 8px;
    font-size: 0.875rem;
}

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

/* 详情样式 */
.detail-group {
    margin-bottom: 20px;
}

.detail-group h4 {
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.detail-item {
    display: flex;
    margin-bottom: 8px;
}

.detail-item .label {
    font-weight: 600;
    width: 120px;
    flex-shrink: 0;
}

.detail-item .value {
    flex-grow: 1;
}

/* 提示消息样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s, transform 0.3s;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background-color: #28a745;
}

.toast.error {
    background-color: #dc3545;
}

/* 状态样式 */
.status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status.active {
    background-color: #d4edda;
    color: #155724;
}

.status.inactive {
    background-color: #f8d7da;
    color: #721c24;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .filter-controls {
        flex-wrap: wrap;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-tables {
        grid-template-columns: 1fr;
    }
}