/* 管理页面专用样式 */

/* 管理页面布局 */
.admin-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background-color: #1a2236;
    padding: 20px 0;
    border-right: 1px solid #2d3746;
    height: 100%;
    overflow-y: auto;
}

.menu {
    display: flex;
    flex-direction: column;
}

.menu-item {
    padding: 12px 20px;
    cursor: pointer;
    color: #9fb2d9;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background-color: #243657;
    color: #fff;
}

.menu-item.active {
    background-color: #243657;
    color: #fff;
    border-left: 3px solid #4a9eff;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* 允许flex项目收缩小于内容大小 */
    background-color: #0f141f;
}

.page-content {
    display: none;
}

.page-content.active {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 {
    margin: 0;
}

/* 用户列表横向排列 */
#userList {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#userList .manage-item {
    margin-bottom: 0;
    flex: 0 0 calc(20% - 10px);
    min-width: 200px;
}

/* 工作列表横向排列 */
#workList {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#workList .manage-item {
    margin-bottom: 0;
    flex: 0 0 calc(25% - 10px);
    min-width: 260px;
}

/* 积分列表横向排列 */
#pointsList {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#pointsList .manage-item {
    margin-bottom: 0;
    flex: 0 0 calc(20% - 10px); /* 每行5列 */
    min-width: 0; /* 允许压缩以适应5列 */
}

/* 考勤列表横向排列 */
#attendanceList {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#attendanceList .manage-item {
    margin-bottom: 0;
    flex: 0 0 calc(25% - 10px);
    min-width: 260px;
}

.attendance-ongoing {
    background-color: #7a1f1f;
}

.attendance-completed {
    background-color: #1f6f3f;
}

/* 管理项目通用样式 */
.manage-item {
    border: 1px solid #1f2a44;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 10px;
}

.manage-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}

.manage-item-header .name {
    font-weight: 600;
}

.manage-item-header .sub {
    font-size: 12px;
    color: #9fb2d9;
}

.manage-item-header .btn.small {
    padding: 4px 8px;
    font-size: 12px;
    margin-left: 5px;
}

/* 信息容器样式 */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.work-info, .points-info, .attendance-info {
    flex: 1;
    overflow: hidden;
}

.work-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.status-ongoing { background-color: #1f6f3f; }
.status-ongoing.status-long { background-color: #7a1f1f; }

.status-completed {
    background-color: #14321d;
}

.btn {
    text-decoration: none;
}

.btn[disabled], .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 卡片内容区域 */
.page-content .card {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* Dashboard Stats */
.dashboard-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    flex: 1;
    background: #1a2236;
    border: 1px solid #2d3746;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.stat-title {
    font-size: 16px;
    color: #9fb2d9;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #e8edf7;
}

/* Override for dashboard card spacing */
#page-dashboard .card {
    background: #1a2236;
    border: 1px solid #2d3746;
    border-radius: 8px;
    margin-bottom: 0;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 60px);
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #2d3746;
        padding: 0;
        overflow-x: auto;
        white-space: nowrap;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .menu {
        flex-direction: row;
        width: max-content;
    }

    .menu-item {
        padding: 15px 20px;
        text-align: center;
        border-left: none;
        border-bottom: 3px solid transparent;
        flex: 0 0 auto;
    }

    .menu-item.active {
        border-left: none;
        border-bottom: 3px solid #4a9eff;
    }

    .main-content {
        overflow-y: visible;
        padding-bottom: 20px;
    }

    .page-content .card {
        padding: 10px;
    }

    .dashboard-stats {
        flex-direction: column;
        gap: 10px;
    }

    #userList .manage-item,
    #workList .manage-item,
    #attendanceList .manage-item,
    #pointsList .manage-item {
        flex: 0 0 100%;
        min-width: 0;
    }
}
