/**
 * 亚马逊订单管理系统 - 样式表
 */

/* 变量定义 */
:root {
    --sidebar-width: 250px;
    --top-navbar-height: 60px;
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* 应用布局 */
.app {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: fixed;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sidebar-brand i {
    font-size: 24px;
}

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

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin: 2px 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
}

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

.nav-link i {
    margin-right: 12px;
    font-size: 18px;
}

.nav-link .badge {
    margin-left: auto;
    font-size: 11px;
}

.nav-link .arrow {
    margin-left: auto;
    transition: transform 0.3s;
}

.nav-item.has-submenu.open .arrow {
    transform: rotate(90deg);
}

/* 子菜单 */
.submenu {
    list-style: none;
    padding-left: 45px;
    display: none;
}

.nav-item.has-submenu.open .submenu {
    display: block;
}

.submenu a {
    display: block;
    padding: 8px 15px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 13px;
    border-radius: 6px;
}

.submenu a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* 顶部导航 */
.top-navbar {
    height: var(--top-navbar-height);
    background: white;
    padding: 0 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-toggle {
    display: none;
    padding: 8px;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
}

.navbar-search {
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

.search-form {
    display: flex;
    gap: 8px;
    position: relative;
}

.search-form input {
    flex: 1;
    border-radius: 20px;
    padding-right: 40px;
}

.search-form button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-form button:hover {
    background: var(--secondary-color);
}

.navbar-actions {
    margin-left: auto;
}

.navbar-actions .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #333;
}

/* 页面内容 */
.page-content {
    padding: 0;
}

/* 统计卡片 */
.stat-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s;
}

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

.stat-card .card-body {
    display: flex;
    align-items: center;
    padding: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-right: 20px;
}

.stat-icon i {
    color: white;
}

.stat-new .stat-icon { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.stat-review .stat-icon { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.stat-production .stat-icon { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stat-completed .stat-icon { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

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

/* 卡片样式 */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.card-header {
    background: white;
    border-bottom: 1px solid #eee;
    padding: 15px 20px;
    font-weight: 600;
}

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

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #666;
    font-size: 13px;
    text-transform: uppercase;
}

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

/* 表单样式 */
.form-label {
    font-weight: 500;
    margin-bottom: 5px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

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

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

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
}

/* Toast 提示 */
.toast {
    border-radius: 10px;
}

/* DataTables 自定义 */
.dataTables_wrapper {
    padding: 20px 0;
}

.dataTables_filter {
    margin-bottom: 15px;
}

.dataTables_paginate {
    margin-top: 15px;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .navbar-search {
        display: none;
    }
    
    .stat-card .card-body {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }
}

/* 加载动画 */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

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

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* 状态标签 */
.badge {
    font-weight: 500;
    padding: 5px 10px;
}

/* 分页样式 */
.pagination {
    margin: 20px 0 0;
    justify-content: center;
}

.pagination .page-link {
    border-radius: 8px;
    margin: 0 3px;
}

/* 下拉菜单 */
.dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 10px;
}

.dropdown-item {
    border-radius: 8px;
    padding: 10px 15px;
}

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

/* 模态框 */
.modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 25px;
}

/* 打印样式 */
@media print {
    .sidebar,
    .top-navbar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
