:root {
    --sidebar-width: 250px;
    --sidebar-bg: #2c3e50;
    --sidebar-hover: #34495e;
    --primary-color: #3498db;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f8f9fa;
    overflow-x: hidden;
}

.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    min-height: 100vh;
    transition: all 0.3s;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
}

.sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-header {
    padding: 20px;
    background: #1a252f;
    color: #fff;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.sidebar .nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    transition: all 0.3s;
}

.sidebar .nav-link i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: var(--sidebar-hover);
}

.sidebar .nav-link.active {
    color: #fff;
    background: var(--primary-color);
}

.content {
    width: 100%;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    transition: all 0.3s;
}

.content.expanded {
    margin-left: 0;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 999;
}

.stat-card {
    border-radius: 10px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-icon.bg-primary-soft {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
}

.stat-card .stat-icon.bg-success-soft {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

.stat-card .stat-icon.bg-warning-soft {
    background: rgba(241, 196, 15, 0.15);
    color: #f1c40f;
}

.stat-card .stat-icon.bg-danger-soft {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2c3e50;
}

.stat-card .stat-label {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.card {
    border-radius: 10px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
}

.table td {
    vertical-align: middle;
}

.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.badge-stock-low {
    background-color: #e74c3c;
}

.badge-stock-normal {
    background-color: #2ecc71;
}

.badge-stock-warning {
    background-color: #f39c12;
}

.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

.form-label {
    font-weight: 500;
    color: #2c3e50;
}

.search-box {
    position: relative;
}

.search-box input {
    padding-left: 35px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
}

.chart-container {
    position: relative;
    height: 300px;
}

@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    
    .sidebar.active {
        margin-left: 0;
    }
    
    .content {
        margin-left: 0;
    }
}

.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.action-btns .btn {
    margin-right: 5px;
}

.action-btns .btn:last-child {
    margin-right: 0;
}

.filter-bar {
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-completed {
    background: rgba(46, 204, 113, 0.15);
    color: #27ae60;
}

.status-pending {
    background: rgba(241, 196, 15, 0.15);
    color: #f39c12;
}

.status-cancelled {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.print-only {
    display: none;
}

@media print {
    .sidebar, .navbar, .btn, .no-print {
        display: none !important;
    }

    .content {
        margin-left: 0 !important;
    }

    .print-only {
        display: block;
    }
}

/* 商品图片缩略图 */
.product-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

/* 商品图片占位符 */
.product-thumb-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 1.5rem;
}
