/* ===== 全局重置 & 字体 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f4f6f9;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== 侧边栏 ===== */
#sidebar {
    width: 250px;
    background: linear-gradient(180deg, #1e2a3a, #0f1724);
    color: #c9d1d9;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0,0,0,0.15);
    z-index: 1000;
}
/* 折叠状态 */
#sidebar.sidebar-collapsed {
    width: 70px;
}
#sidebar.sidebar-collapsed .brand-text,
#sidebar.sidebar-collapsed .label {
    display: none;
}
#sidebar.sidebar-collapsed .brand-icon {
    font-size: 1.8rem;
    margin-right: 0;
}
#sidebar.sidebar-collapsed .sidebar-nav ul li a {
    justify-content: center;
    padding: 12px 0;
}
#sidebar.sidebar-collapsed .sidebar-nav ul li a .icon {
    font-size: 1.6rem;
    margin-right: 0;
}

/* 品牌区 */
.sidebar-brand {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-icon {
    font-size: 1.8rem;
}
.brand-text {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 1px;
    color: #ecf0f1;
}

/* 导航菜单 */
.sidebar-nav ul {
    list-style: none;
    padding: 10px 0;
}
.sidebar-nav ul li a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: #b0bec5;
    text-decoration: none;
    transition: all 0.2s;
    margin: 4px 10px;
    border-radius: 8px;
    gap: 12px;
}
.sidebar-nav ul li a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.sidebar-nav ul li a.active {
    background: #007bff;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}
.sidebar-nav ul li a .icon {
    font-size: 1.3rem;
    width: 24px;
    text-align: center;
}
.sidebar-nav ul li a .label {
    font-size: 0.95rem;
}

/* ===== 主区域 ===== */
#main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s;
}

/* ===== 顶部导航栏 ===== */
#topbar {
    background: #fff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 999;
    min-height: 64px;
}
.toggle-btn {
    font-size: 1.6rem;
    cursor: pointer;
    color: #495057;
    user-select: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}
.toggle-btn:hover {
    background: #e9ecef;
}
.topbar-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #212529;
    flex: 1;
    margin-left: 16px;
}
.topbar-right .badge {
    background: #007bff;
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* ===== 内容区 ===== */
#content {
    flex: 1;
    padding: 20px 24px;
    background: #f4f6f9;
}
.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== 统计卡片 ===== */
.small-box {
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}
.small-box:hover {
    transform: translateY(-4px);
}
.small-box .inner h3 {
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
}
.small-box .inner p {
    font-size: 1rem;
    opacity: 0.9;
    margin: 4px 0 0;
}
.small-box .icon {
    position: absolute;
    right: 16px;
    top: 16px;
    font-size: 3.2rem;
    opacity: 0.25;
}
.small-box .small-box-footer {
    display: inline-block;
    margin-top: 12px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-weight: 500;
}
.small-box .small-box-footer:hover {
    color: #fff;
}
.bg-info { background: linear-gradient(135deg, #17a2b8, #0d8aa0); }
.bg-success { background: linear-gradient(135deg, #28a745, #1e7e34); }
.bg-danger { background: linear-gradient(135deg, #dc3545, #bd2130); }
.bg-warning { background: linear-gradient(135deg, #ffc107, #e0a800); }

/* ===== 卡片 ===== */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 24px;
    border: none;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-header .card-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #212529;
}
.card-body {
    padding: 20px;
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th {
    background: #f8f9fa;
    font-weight: 600;
    padding: 10px 12px;
}
.table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e9ecef;
}
.table-hover tbody tr:hover {
    background: #f1f3f5;
}
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}
.badge-success { background: #28a745; color: #fff; }
.badge-secondary { background: #6c757d; color: #fff; }
.badge-info { background: #17a2b8; color: #fff; }
.badge-light { background: #f8f9fa; color: #212529; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    #sidebar {
        width: 70px;
    }
    #sidebar .brand-text,
    #sidebar .label {
        display: none;
    }
    #sidebar .brand-icon {
        font-size: 1.8rem;
        margin-right: 0;
    }
    #sidebar .sidebar-nav ul li a {
        justify-content: center;
        padding: 12px 0;
    }
    #sidebar .sidebar-nav ul li a .icon {
        font-size: 1.6rem;
        margin-right: 0;
    }
    #sidebar.sidebar-collapsed {
        width: 0;
        overflow: hidden;
        padding: 0;
    }
    #main-wrapper {
        margin-left: 0;
    }
    #topbar {
        padding: 10px 16px;
    }
    #content {
        padding: 16px;
    }
    .small-box .inner h3 {
        font-size: 1.6rem;
    }
}