/* 售后助手管理后台 - 自定义样式 */
:root {
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #4f46e5;
}

/* 登录页 */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-container {
    width: 100%;
    max-width: 420px;
}
.login-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
}
.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: white;
    font-size: 28px;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: #cbd5e1;
    z-index: 1040;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}
.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}
.sidebar-title h5 {
    color: white;
    font-size: 16px;
}
.sidebar-title small {
    color: #94a3b8;
}
.sidebar-close {
    margin-left: auto;
    color: #94a3b8;
}
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}
.sidebar-nav .nav-link {
    color: #cbd5e1;
    padding: 10px 20px;
    border-radius: 0;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    margin: 2px 8px;
    border-radius: 8px;
}
.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: white;
}
.sidebar-nav .nav-link.active {
    background: var(--sidebar-active);
    color: white;
}
.sidebar-nav .nav-link .badge {
    margin-left: auto;
}
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* 主内容区 */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
}

/* 顶部导航 */
.topbar {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 24px;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1030;
}

/* 内容区 */
.content-area {
    flex: 1;
    padding: 24px;
}

/* 页脚 */
.footer {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 16px 24px;
}

/* 统计卡片 */
.stat-card {
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

/* 头像 */
.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 14px;
}
.avatar-md {
    width: 48px;
    height: 48px;
    font-size: 20px;
}
.avatar-lg {
    width: 80px;
    height: 80px;
    font-size: 32px;
    object-fit: cover;
}

/* 时间线 */
.timeline {
    position: relative;
    padding-left: 24px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}
.timeline-item {
    position: relative;
    padding-bottom: 20px;
}
.timeline-item:last-child {
    padding-bottom: 0;
}
.timeline-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #e2e8f0;
}

/* 表格优化 */
.table > :not(caption) > * > * {
    padding: 12px 16px;
}
.table thead th {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    border-bottom-width: 1px;
}

/* 暗色模式 */
[data-bs-theme="dark"] {
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
}
[data-bs-theme="dark"] .main-content {
    background: #0f172a;
}
[data-bs-theme="dark"] .topbar,
[data-bs-theme="dark"] .footer,
[data-bs-theme="dark"] .card {
    background: #1e293b !important;
    border-color: #334155 !important;
}
[data-bs-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}
[data-bs-theme="dark"] .table {
    --bs-table-bg: #1e293b;
    --bs-table-color: #e2e8f0;
    --bs-table-border-color: #334155;
}
[data-bs-theme="dark"] .table thead th {
    color: #94a3b8;
}
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #0f172a;
    border-color: #6366f1;
    color: #e2e8f0;
}

/* 移动端适配 */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .content-area {
        padding: 16px;
    }
    .offcanvas-backdrop.show {
        opacity: 0.5;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 主题切换按钮 */
.theme-toggle {
    border-radius: 50%;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
