/* ========================================
   EnterpriseCMS - 现代仪表盘风格
   参考: chinazaz 4100 模板风格
   ======================================== */

:root {
    /* 深色侧边栏配色 */
    --sidebar-bg: #1a1a2e;
    --sidebar-hover: #252542;
    --sidebar-active: #16213e;
    --sidebar-text: #a0aec0;
    --sidebar-text-active: #ffffff;
    --sidebar-border: rgba(255, 255, 255, 0.1);
    --sidebar-width: 260px;
    
    /* 主色调 */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: rgba(79, 70, 229, 0.1);
    
    /* 功能色 */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* 背景色 */
    --bg-dark: #0f0f1a;
    --bg-main: #f5f7fa;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    
    /* 文字色 */
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.15);
}

/* ========================================
   基础重置
   ======================================== */
body { 
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    color: var(--text-dark);
    min-height: 100vh;
}

/* ========================================
   后台整体布局
   ======================================== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   侧边栏 - 深色风格
   ======================================== */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: all 0.3s ease;
}

.admin-sidebar::-webkit-scrollbar {
    width: 6px;
}

.admin-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Logo区域 */
.sidebar-logo {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo .logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.sidebar-logo .logo-text {
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.sidebar-logo .logo-text span {
    color: #818cf8;
}

/* 菜单容器 */
.sidebar-menu {
    padding: 16px 12px;
}

/* 菜单区块 */
.menu-section {
    margin-bottom: 24px;
}

.menu-section-title {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #64748b;
}

/* 菜单项 */
.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.menu-item:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.menu-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.menu-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.menu-item:hover .menu-icon,
.menu-item.active .menu-icon {
    background: rgba(255, 255, 255, 0.15);
}

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

/* 顶部导航 */
.admin-header {
    background: var(--bg-card);
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-toggle {
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 20px;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    min-width: 240px;
}

.header-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    width: 100%;
    color: var(--text-dark);
}

.header-search input::placeholder {
    color: var(--text-light);
}

.header-notifications {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 18px;
}

.header-notifications .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px 6px 6px;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.header-user .avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.header-user .user-info {
    display: flex;
    flex-direction: column;
}

.header-user .user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.header-user .user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* 内容区域 */
.content-area {
    padding: 32px;
}

/* 页面标题 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-dark);
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========================================
   统计卡片网格
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 28px;
}

.stat-icon.primary { background: var(--primary-light); }
.stat-icon.success { background: #d1fae5; }
.stat-icon.warning { background: #fef3c7; }
.stat-icon.danger { background: #fee2e2; }

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-change {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ========================================
   内容卡片
   ======================================== */
.content-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--bg-hover);
}

.content-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ========================================
   表格
   ======================================== */
.data-table-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-hover);
}

.data-table th {
    padding: 16px 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--bg-hover);
    font-size: 14px;
    color: var(--text-dark);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: var(--primary-light);
}

/* ========================================
   按钮
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* ========================================
   标签
   ======================================== */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.tag-primary { background: var(--primary-light); color: var(--primary); }
.tag-success { background: #d1fae5; color: #047857; }
.tag-warning { background: #fef3c7; color: #92400e; }
.tag-danger { background: #fee2e2; color: #b91c1c; }

/* 状态徽章 */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-badge.active { background: #d1fae5; color: #047857; }
.status-badge.active .dot { background: #10b981; }

.status-badge.inactive { background: #fef3c7; color: #92400e; }
.status-badge.inactive .dot { background: #f59e0b; }

.status-badge.pending { background: #e0e7ff; color: #4338ca; }
.status-badge.pending .dot { background: #6366f1; }

/* ========================================
   筛选栏
   ======================================== */
.filter-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 20px 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.filter-bar input,
.filter-bar select {
    padding: 12px 16px;
    border: 2px solid var(--bg-hover);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-card);
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.filter-bar input:focus,
.filter-bar select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* ========================================
   分页
   ======================================== */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 32px;
}

.pagination a {
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--bg-hover);
    color: var(--text-dark);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ========================================
   提示框
   ======================================== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.alert-success { background: #ecfdf5; color: #047857; border-left: 4px solid #10b981; }
.alert-error { background: #fef2f2; color: #b91c1c; border-left: 4px solid #ef4444; }
.alert-warning { background: #fffbeb; color: #92400e; border-left: 4px solid #f59e0b; }
.alert-info { background: #eff6ff; color: #1e40af; border-left: 4px solid #3b82f6; }

/* ========================================
   表单
   ======================================== */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--bg-hover);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* ========================================
   响应式
   ======================================== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .header-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .content-area {
        padding: 16px;
    }
    
    .page-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-bar input,
    .filter-bar select {
        width: 100%;
    }
}